We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Does Slider Work ?
#6
Hi ata,zs,coder

I'm totally not sure I fully follow what you are describing, but I think it may be the following.

The amount you move the images is always + or - 2 pixels, depending on if the slider is high or lower compared to the last time it was set.

The slider event will only be called 'as the OS detects a change'.  If you move it very fast, then the slider may go up 20% and the images move up 2 pixels.  If you then move the slider slowly down 20% to where you started the slider event may be called several (say 5 times) and the images will move a total of 10 pixels down.

So, depending on the speed you move the slider, the images and slider can get out of sync.

To fix, I first suggest that you write out some debugging data like TextWindow.WriteLine(z) inserted after line 21.

Then, what you want is the absolute position (y coord) of the images to be related to the absolute position (value) of the slider - no need to store old values in the stack.  I leave you to figure this a bit, rather than modifying your code.
[-] The following 2 users Like litdev's post:
  • ata, z-s
Reply


Messages In This Thread
How Does Slider Work ? - by ata - 07-16-2024, 06:51 AM
RE: How Does Slider Work ? - by z-s - 07-16-2024, 07:02 AM
RE: How Does Slider Work ? - by ata - 07-16-2024, 07:07 AM
RE: How Does Slider Work ? - by z-s - 07-16-2024, 12:35 PM
RE: How Does Slider Work ? - by coder - 07-16-2024, 05:14 PM
RE: How Does Slider Work ? - by litdev - 07-16-2024, 06:15 PM
RE: How Does Slider Work ? - by ata - 07-17-2024, 03:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)