Looping Backgrounds

For questions about using Classic.

Post » Tue Jan 27, 2009 4:59 am

Ive been trying for a little bit to create a loop of a background, with a number of different results. Is there an optimal way to do this? What I am trying to do is create a moving background that loops the same image from right to left without a lot of stuttering.
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Tue Jan 27, 2009 5:10 am

How big is this image? As long as it's not super huge, you should be able to make it loop with Tiled Background. You could scroll the texture with "Set image offset."
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jan 27, 2009 5:24 am

On the subject of tiled backgrounds, is there any reason you can't animate one? I have a tiled animation, and it'd be nice to be able to tile it without having many many copies of a single sprite, just for a background image.
B
2
G
3
Posts: 71
Reputation: 992

Post » Tue Jan 27, 2009 5:32 am

The image is designed to fill the entire screen (so 1280x1024). How does the offset work? I have tried to use the "move at angle command". Is the offset designed to be used to fix some of the problems with that?
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Tue Jan 27, 2009 5:37 am

That just might work fieari..... Ill give it a shot.
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Tue Jan 27, 2009 6:04 am

[quote="JudgementLoaf":2tj6q53q]The image is designed to fill the entire screen (so 1280x1024). How does the offset work? I have tried to use the "move at angle command". Is the offset designed to be used to fix some of the problems with that?[/quote:2tj6q53q]

If you want a constantly scrolling background, you could set the offset to the Timer value. Like this:

+Always
-TiledBackground: Set image offset to Timer / 8, 0

Changing the value 8 will change the speed; lower numbers scroll faster while higher numbers scroll slowly. Also, dividing the Timer value by negative numbers will make it scroll in the opposite direction.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Tue Jan 27, 2009 6:05 am

[quote="JudgementLoaf":1o9opn0q]The image is designed to fill the entire screen (so 1280x1024). How does the offset work?[/quote:1o9opn0q]

It works like this:
http://willhostforfood.com/files3/17687/scroll.cap

Until there's an expression for "Get offset" you'll have to use a variable like that.

[quote="fieari":1o9opn0q]On the subject of tiled backgrounds, is there any reason you can't animate one?[/quote:1o9opn0q]

Yes... tiles don't have animation. That's what sprites are for.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jan 27, 2009 8:11 am

Thanks alot!
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Tue Jan 27, 2009 10:45 pm

Out of curosity, what is the largest size this will support? 256x256??
B
2
G
4
Posts: 49
Reputation: 1,148

Post » Tue Jan 27, 2009 11:21 pm

As far as I know it will support any size as long as it fits in your VRAM. :P
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests