scrolling background IPAD

OxygenOxygen Member Posts: 14
edited November -1 in Working with GS (Mac)
hello there !!!
I'm trying to make a scrolling background for an IPAD game.

this method by Quantumsheep works very well for iphone landscape, portrait but i don't know why this does work with IPAD portrait !?!

I tried this method with a background picture of 768*1024
thanks for help

"quantumsheep said:
You can make your background like this:

Say it's a starfield. Actor size doesn't matter - when you place it in your scene, just stretch it so it fills the screen.

This actor will contain the following

A movement behaviour (say direction 180, speed 90 if you're doing a side scroller).

Then underneath this a single rule:
When
Attribute self.position.X < - self.Size.Width /2

Change attribute self.position.X to self.Position.X + self.Size.Width + game.Display Size.Width

Then, put the actor in your scene as described above, and add a second instance of the actor next to it of equal size.

This will allow smooth scrolling, and will mean you can get rid of the wrap.

Hope that helps :)"

Comments

  • OxygenOxygen Member Posts: 14
    nobody there?
  • quantumsheepquantumsheep Member Posts: 8,188
    Actually, I have the same problem on the iPad myself!

    Would be interested in a solution too!

    QS :)
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I think maybe it's because the image is so large, instead of two images, try cutting them so its four of them. I'll see if I can make a demo tonight.
  • OxygenOxygen Member Posts: 14
    Oh Quantumsheep, u too, sorry for the message i didn't know.

    Ok jonmulcahy, i'll try this too

    thanks guys for those answers
  • OxygenOxygen Member Posts: 14
    Ok guys it works very fine : here is the method from Jonmulcahy based on Quantumsheep code :
    we needs an actor with size of 768*512 (half of the scene height)
    In this actor :

    move direction 270

    rule when self.position.Y < -self.size.height/2
    change attribute self.position.Y to self.postion.Y+self.size.height+game.display.size.height

    after that, place this actor at position 384, 256 then a copy at 384,768 and finally another copy at 384,1280

    here we go !!! tested to a speed at 2000, impressively smooth !!!!

    thank you guys
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Fantastic. Glad that worked.

    GS does some funny things when you get far enough off screen
  • quantumsheepquantumsheep Member Posts: 8,188
    Nice one! Will have to try it out! :)
Sign In or Register to comment.