I have set up two buttons to scroll up and down through an offscreen list object. the selected line is displayed in an edit box and this all works ok. I have setup 2 counters to show which line of the list you are on out of the total number of lines. I want it so that if you press up or down at the bottom or top of the list it scrolls to top or bottom depending on where you are. e.g. bottom of list goes to top and top goes to bottom. I have succesfully got it to perform the top to bottom scroll but i cannot get it to do bottom to top. here is the code i am using:
Button "Up" Clicked
+ Counter "Line number" = 1
---- Set Current Line of "List Object" to Current Value of "Number of Lines"
This bit above works!!
Button "Down" Clicked
+ Counter "Line number" = Counter "Number of lines"
---- Set Current Line of "List Object" to 1
In theory this works but in practice it jumps to line 2!! Can anyone tell me why??
By a route obscure and lonely,
Haunted by ill angels only,
Where an Eidolon, named night,
On a black throne reigns upright,
I have reached these lands but newly
From an ultimate dim Thule
From a wild clime that lieth, sublime,
Out of space
Out of time.
Always: set list line number to counter
Up is pressed: subtract 1 from counter.
Down is pressed: add 1 to counter.
Counter == 0: set counter to number of lines.
Counter == number of lines + 1: set counter to 1.
I think your error is probably in how the code you posted interact with your standard list object moving (possibly in their relative order), but I'm not sure.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
Button "Down" Clicked
+ Counter "Line number" = Counter "Number of lines"
---- Set Current Line of "List Object" to 1
In theory this works but in practice it jumps to line 2!! Can anyone tell me why??
.....dunno if it'll work, but try changing the third line to:
---- Set Current Line of "List Object" to 0
Let me know if it works; MMF can be a bit weird and i have found solutions like the above have worked in the past! If it jumps to line 2 instead of 1, this (in theory) should work. Should