GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How can i scroll the background on y-axis?

fongorfongor Posts: 18Member, PRO


Thanks for helping!

Comments

  • fongorfongor Posts: 18Member, PRO

    Please~~

  • NNterprisesNNterprises Posts: 387Member, PRO

    It all depends on what you need you need to be specific. Is it just a moving background? Does it scroll when you swipe? ... etc

    But if you want it to move in the background you can do a lot of things...

    Make a background actor and stretch it to the size needed

    Choose one of the following to make it move down 1000 pixels for 10 seconds:

    1. Put a rule in the actor to Interpolate self.position.Y to -1000 in 10 seconds .
    2. Just go into attributes and make linear velocity Y = -100
    3. Put a rule in the actor to Move in direction DOWN (270 maybe i think) with speed -100
    4. You can also use Constrain self.position.y to self.position.y - # (don't feel like doing math)
    5. You can use accelerate but that's a bit different
    6. "Move to"
    7. More things
  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,579Member, BASIC

    Below is a tutorial about scrolling on the X axis, you could use the same methods but use the Y axis instead. I believe the source file download (linked in the description) has both horizontal and vertical samples.

  • fongorfongor Posts: 18Member, PRO

    @NNterprises said:
    It all depends on what you need you need to be specific. Is it just a moving background? Does it scroll when you swipe? ... etc

    But if you want it to move in the background you can do a lot of things...

    Make a background actor and stretch it to the size needed

    Choose one of the following to make it move down 1000 pixels for 10 seconds:

    1. Put a rule in the actor to Interpolate self.position.Y to -1000 in 10 seconds .
    2. Just go into attributes and make linear velocity Y = -100
    3. Put a rule in the actor to Move in direction DOWN (270 maybe i think) with speed -100
    4. You can also use Constrain self.position.y to self.position.y - # (don't feel like doing math)
    5. You can use accelerate but that's a bit different
    6. "Move to"
    7. More things

    um...I can't make it works,i want the background unlimited automatically move up,anyway,thanks for your help!!

  • fongorfongor Posts: 18Member, PRO

    @jamie_c said:
    Below is a tutorial about scrolling on the X axis, you could use the same methods but use the Y axis instead. I believe the source file download (linked in the description) has both horizontal and vertical samples.

    I have already tried it ,it seems not work on y-axis 90 angle

  • fongorfongor Posts: 18Member, PRO

    @fongor said:

    @NNterprises said:
    It all depends on what you need you need to be specific. Is it just a moving background? Does it scroll when you swipe? ... etc

    But if you want it to move in the background you can do a lot of things...

    Make a background actor and stretch it to the size needed

    Choose one of the following to make it move down 1000 pixels for 10 seconds:

    1. Put a rule in the actor to Interpolate self.position.Y to -1000 in 10 seconds .
    2. Just go into attributes and make linear velocity Y = -100
    3. Put a rule in the actor to Move in direction DOWN (270 maybe i think) with speed -100
    4. You can also use Constrain self.position.y to self.position.y - # (don't feel like doing math)
    5. You can use accelerate but that's a bit different
    6. "Move to"
    7. More things

    um...I can't make it works,i want the background unlimited automatically move up,anyway,thanks for your help!!

    i found the y-axis file!thanks

  • fongorfongor Posts: 18Member, PRO

    @fongor said:

    @jamie_c said:
    Below is a tutorial about scrolling on the X axis, you could use the same methods but use the Y axis instead. I believe the source file download (linked in the description) has both horizontal and vertical samples.

    I have already tried it ,it seems not work on y-axis 90 angle

    But it doesn't on 90 y-axis

  • NNterprisesNNterprises Posts: 387Member, PRO

    Not sure what you're saying by 90 y axis... You're just saying "move straight up" right? Are you trying to rotate it to 90 degrees too?

    You just want it to move UP VERTICALLY right (on the Y axis)?

  • fongorfongor Posts: 18Member, PRO

    @NNterprises said:
    Not sure what you're saying by 90 y axis... You're just saying "move straight up" right? Are you trying to rotate it to 90 degrees too?

    You just want it to move UP VERTICALLY right (on the Y axis)?

    yup!that's what i want!

  • NNterprisesNNterprises Posts: 387Member, PRO

    You may have to post your file, if Jamie's tutorial didn't work if you switched it to Y instead of X, and if none of mine worked, there's a bigger issue that we cannot see

    Make sure MOVEABLE is checked in your background actor too maybe

  • fongorfongor Posts: 18Member, PRO
    edited July 2016

    @NNterprises said:
    You may have to post your file, if Jamie's tutorial didn't work if you switched it to Y instead of X, and if none of mine worked, there's a bigger issue that we cannot see

    Make sure MOVEABLE is checked in your background actor too maybe

    When I use your method, the background will scroll, but I want to be one after the other with a scroll background

  • imjustmikeimjustmike Posts: 450Member

    Do you mean parallax scrolling?

  • fongorfongor Posts: 18Member, PRO

    @imjustmike said:
    Do you mean parallax scrolling?

    Nope,it's like I want 90 degrees.thanks for your help!

  • imjustmikeimjustmike Posts: 450Member

    The issue is, we don't know what you mean by "I want 90 degrees" - try saying it a different way. From what I can tell you want a vertically scrolling background, which people have provided you solutions for. Either you're not following the tutorials correctly, or there's some other issue in your code. OR we have no idea what you mean and are going round in circles.

  • KevinCrossKevinCross London, UKPosts: 1,893Member

    Do you want to scroll the background down or up?

  • fongorfongor Posts: 18Member, PRO

    @KevinCross said:
    Do you want to scroll the background down or up?

    scroll it up,thanks!

  • KevinCrossKevinCross London, UKPosts: 1,893Member

    @fongor said:

    @KevinCross said:
    Do you want to scroll the background down or up?

    scroll it up,thanks!

    I've amended the code in the video tutorial from @jamie_c so that it scrolls upwards (see attached)

Sign In or Register to comment.