How to change scrollspeed for different backgrounds?

wolkilula

  • Posts: 12
Hello everybody,

I've searching for the right code to change the scrollspeed for more than one background during the game.

Found this to change: "setScrollSpeedForBackground(x, y);"
But how can I change the speed for each single background.

Hope you can help me and thx for reading,

wolkilula

GeoPro

  • Posts: 36
Im not entirely sure what you are asking but, if you go into the main menu (the one that appears when you first open up a game), then click on backgrounds on the left side. When you create a background from there it'll give you the option to set scroll speed for each one you make.

Max Finch

  • *
  • Posts: 2174
1) Go to scene logic and create a new logic.

2) Go to attributes in logic screen and click the create new (This is actor only attribute)

3) create 2 number attributes X and Y

4) Make statement (When created> Set scroll speed to X=X(X you created) and Y=Y(Y you created))

now attach it to every scene you will see X and Y set each one of those to the desired scroll speed


beniwood

  • Posts: 5
1) Go to scene logic and create a new logic.

2) Go to attributes in logic screen and click the create new (This is actor only attribute)

3) create 2 number attributes X and Y

4) Make statement (When created> Set scroll speed to X=X(X you created) and Y=Y(Y you created))

now attach it to every scene you will see X and Y set each one of those to the desired scroll speed

It will change the background speed for all backgrounds in this scene. But I have 4 backgrounds with different speed in my scene. How can I change each one's speed ingame?

Thanks

« Last Edit: July 11, 2012, 08:57:55 am by beniwood »

beniwood

  • Posts: 5
UP. Does someone have an idea about how to do it?

beniwood

  • Posts: 5
Does this mean nobody knows how to do it? or it's just impossible with stencyl?

Rexasul

  • Posts: 147
In the dashboard, click backgrounds and then 'add background'. You can set scrolling parameters as well as parrallax scrolling factor (needs to be a repeated background). In the scene editor, click background and add the backgrounds you created and set their layer order as required.
my website |>>| shadowlabs.net

froz

  • Posts: 250
I'm not sure this answers his question.

Quote
I've searching for the right code to change the scrollspeed for more than one background during the game.

Unfortunatelly I don't know the answer and I was hoping someone would post it.

Rexasul

  • Posts: 147
I'm not sure this answers his question.

Quote
I've searching for the right code to change the scrollspeed for more than one background during the game.

Unfortunatelly I don't know the answer and I was hoping someone would post it.

Oops, I saw his post count and assumed he overlooked the background feature. The only way I can think of is bit of a workaround - tiling a background actor using offscreen bounds and the widths and setting each background types' speed to an attribute that can be managed elsewhere.

edit* I didn't read one single post in this thread. I haven't slept for 2 days and that's the excuse I'm sticking with.

« Last Edit: July 13, 2012, 07:14:16 am by Rexasul »
my website |>>| shadowlabs.net