Scrolling background with Letterbox scale

Get help using Construct 2

Post » Tue Mar 12, 2013 12:23 am

Hi,

I use a scrolling background in my project... It works well...

But when I use it with the "Letterbox scale" my background don't cover all the layout.

Someone can help me ? :)
Or it's a bug ? :(


This is my .capx :

http://dl.dropbox.com/u/25194731/Z-contamination-2.0.capx

tks.
B
2
Posts: 4
Reputation: 508

Post » Tue Mar 12, 2013 12:45 am

What do you mean by 'letterbox scale'?

I noticed you're trying to make the background scroll by doubling the size of the background at program start and then having repositioned once it gets off the screen. This is a little inefficient in my opinion.

Just make a layer for the background, load the background image as a sprite, and then set that sprite to wrap. Have the sprite move some number of pixels on every tick, set the parallax to the background layer to something like 100, 30 and that should do it (you may have to make a few tweaks).
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Tue Mar 12, 2013 1:50 am

why move the sprite every tick if you are setting parallax? And is there an advantage to wrap as opposed to using a tlied background object and setting it to the width of the layout?
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Tue Mar 12, 2013 1:57 am

No idea on the sprite and parallax, I'm probably just getting confused because I'm working on a space shooter that uses multiple moving backgrounds.

There isn't one method that's better than the other in the case of sprite with wrap versus tiled background object. My claim was that he was doubling the size of the tiled background and repositioning it after it got off the screen, and I felt that it could be more optimized.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194


Return to How do I....?

Who is online

Users browsing this forum: makkancs, Matthew de and 37 guests