![]() |
Help with displaying..
Ok, I was just wondering if anyone could explain and show examples of how exactly to display x ammt of variables in an array, and than be able to scroll through the rest of the variables in the array. Eg: this.array = {1, 2, 3, 4, 5, 6}; I want to do a text showing of the first 1, 2, 3, 4, 5, have the 6 hide, than when I click a button the text will display, 2, 3, 4, 5, 6 (scrolling downwards). Can someone help me please?
|
PHP Code:
this.scrollto = this.scrollto%this.array.size()-5; will roll it back to 0 if you increase it to much. From there, you simply add in whatever keyboard or mouse controls to increase this.scrollto. Alternatively, you can also simply display ALL of the data in a scroll GUI, and manipulate that. |
I've done this before, and it displays 1, 2, 3, 4, 5. Than I increase the scrolling variable and its displays 1, 2, 3, 4, 5, 6. When what I want it to display is 2, 3, 4, 5, 6. (Hiding the 1). The thing is I'm not sure of is how to hide the 1.
|
Ahh... Try this instead:
PHP Code:
You can also simply detect when there is a change in what's being hidden(this.scrollto changing) and hide all the images before you display them again. The next loop will refresh them, therefor hiding all the unused and showing the current properly. |
Just do
PHP Code:
|
Okay I've figured out the scrolling thing thanks to Dusty and little help from Chompy. Now I've got another question relating to wraptext(), I can't seem to figure out how to get this to work at all. Chompy tried to give me a solution using wraptext2() but it didn't work at all so I came up with my own way which is working a little better than Chompy's but still isn't working, Would anyone mind pointing out the problem and explaining what's wrong with it?
PHP Code:
|
thiso.testmsg should be this.testmsg.
|
| All times are GMT +2. The time now is 10:12 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.