|
|
#1 |
|
Senior Member
|
I'm trying to put a wu shader visualization in my skin by using
SystemObject.getLeftVuMeter(); etc.... now this is a problem: I don't know how to run my function constantly, because when I press Play button it runs only once, but I would want it to run constantly. Is there any way to code it? Maybe running it every 10 miliseconds? This is a code: System.onPlay(){ wushader(); } wu_shader(){ int L, R; L = System.getLeftVuMeter(); L = L/255 * 128; R = System.getRightVuMeter(); R = R/255 * 128; WuImageL.resize(215,86,L,4); WuImageR.resize(215,100,R,4); } |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Dec 2000
Location: Somewhere, USA
Posts: 2,233
|
use a timer with a very small delay and do:
code: I'm sure my code is a little clumsy but i think it gets the job done. |
|
|
|
|
|
#3 |
|
Forum King
Join Date: Dec 2000
Location: Somewhere, USA
Posts: 2,233
|
the getPlayItemString member function is used to see if anything is currently playing. The play sring is nothing when nothing is playing so if the string isn't nothing, then the timer should start because a song is already playing when the script was loaded.
|
|
|
|
|
|
#4 |
|
Senior Member
|
Thanks dude! I understand scripting, you don't have to explain it
By the way, your script has some mistakes, but I managed to fix them. Now it works perfectly. And also I'm using a bit higher delay, 120 milliseconds, but in time between another function resizes layer slowly from one point to another if you understand what am I saying. This way it looks smoother Thanks for your help
|
|
|
|
|
|
#5 |
|
Forum King
Join Date: Dec 2000
Location: Somewhere, USA
Posts: 2,233
|
yea .. i hacked out that script in like 5 min so it probably sucked big time, but i'm glad you got the general gist of it.
Hope the skin works out great. |
|
|
|
|
|
#6 |
|
Senior Member
|
I don't know about skin working out great
Also, one more question for everyone who knows scripting more than I do: Function abcd(); abcd{ Timer slow; slow = new Timer; slow.setDelay(10); slow.onTimer(){ argument 1; argument 2; argument 3; // etc...... } } Why the italic text isnt possible??? When I try to compile it, it says syntax error and points at "{". Then I set this: slow.onTimer(); So I have question. When I set that argument, is it working as a delay of 10 miliseconds (pauses script before continuing) or does nothing, and is it possible to call an extern Function from within other Function by using onTimer (or simply put some arguments in onTimer block). Thanx |
|
|
|
|
|
#7 |
|
Major Dude
|
Function abcd();
abcd() { Timer slow; slow = new Timer; slow.setDelay(10); [I] slow.onTimer(){ argument 1; argument 2; argument 3; // etc...... } Insert Red Text /* S0Be */ And On that day, the Lords of the land said unto their Master Architect, "The temple you have made to the gods of Wasabi and Maki has brought us no great prosperity" and they sent out him into the lands. As he traveled to a far off land, he found he wasn't traveling alone, but that he had gained companions, and when they found their new land, they started work on a new temple, one that would be OPEN to all who wanted to worship. from The Book of Wasabi C 12 Vs 09 (pg 2003)
|
|
|
|
|
|
#8 |
|
Senior Member
|
brackets were mistake in question, not in real script
I'm still searching for answer on my previous post
|
|
|
|
|
|
#9 |
|
Forum King
Join Date: Mar 2001
Location: irc.tehflap.org/*******
Posts: 3,085
|
have you tried without arguments?
|
|
|
|
|
|
#10 | |
|
French Admin
Join Date: Nov 2000
Posts: 329
|
Quote:
Global Timer slow; // <- make "slow" a global variable accessable by all functions/events Function abcd(); abcd() { slow = new Timer; slow.setDelay(10); } // <- close function abcd slow.onTimer(){ argument 1; argument 2; argument 3; // etc...... } Francis. Bluemars - Music For The Space Traveller |
|
|
|
|
|
|
#11 |
|
Major Dude
|
heh, I didn't even notice the discrepency in the braces... it's a monday...
/* S0Be */ And On that day, the Lords of the land said unto their Master Architect, "The temple you have made to the gods of Wasabi and Maki has brought us no great prosperity" and they sent out him into the lands. As he traveled to a far off land, he found he wasn't traveling alone, but that he had gained companions, and when they found their new land, they started work on a new temple, one that would be OPEN to all who wanted to worship. from The Book of Wasabi C 12 Vs 09 (pg 2003)
|
|
|
|
|
|
#12 |
|
Forum King
Join Date: Dec 2000
Location: Somewhere, USA
Posts: 2,233
|
yea.. Francis is right. 'slow' is only used in the braces and nowhere else. Atleast thats how the compiler interperets it
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|