Vertical Scrolling Items

Hi,
I have seen some of the older discussions of having a scrolling items list, but I have not gotten them to work fully. I have attached an example project with what I did, I did a lot of what @tatiang did, but I could not get the snapback to work completely and sometimes I would have objects disappear, and I cant make it stop at 19.

Thanks

http://www.mediafire.com/?92vzjtp20r24uz4

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @AppTek -- I took a look and I don't see anything wrong. It stops on 19 pretty easily, and the snap-back seems to work OK.

    I couldn't figure out what the first timer (that everything is wrapped in) does. I took it out and everything seems to work OK.

    Also the timer that is set to 0.0001 really can't go that fast. About the fastest that a timer can go is .033 seconds. (I think that comes out to 60 frames a second.) Just change it to .033. Or if you want it to go as fast as the device can just change it to 0 seconds. (But it still won't go any faster than .033 seconds.)

    Anyway, it seems to be working OK. Not sure what issue is concerning you.
  • AppTekAppTek Member Posts: 152
    @Rthurman
    That first timer was to stop some items from flying off, not sure why it works though. I'll change that time to .033 and the problem I saw with 19 is that if you scroll past it, it doesnt stop. I couldn't figure out how to get it to stop.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I couldn't figure out how to get my sliders to stop moving, either, so I ended up just constraining their positions to a min/max function set to some offset amount (e.g. their original Y position + 200 pixels).
  • AppTekAppTek Member Posts: 152
    I couldn't figure out how to get my sliders to stop moving, either, so I ended up just constraining their positions to a min/max function set to some offset amount (e.g. their original Y position + 200 pixels).
    @tatiang How can I implement the min/max function though.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @AppTek that was a brain-buster. Here's the function I used but I honestly don't have the energy to explain each attribute as they are combinations of other math functions and stored elsewhere in my rules.

    image

    Pretty sure you could just substitute self.position.Y-200 or self.position.Y+200 for those Above and Below attributes. The others are just determined when the player clicks/taps.

    Hope that's a little helpful and I'm sorry I can't spell it out right now.
  • AppTekAppTek Member Posts: 152
    @tatiang Thanks, that really helps!
  • AppTekAppTek Member Posts: 152
    @tatiang What does the PressY stand for, and can you explain how that works? Thanks!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's game.mouse.position.Y
Sign In or Register to comment.