Prev Previous Post   Next Post Next
Old 21st April 2004, 19:04   #1
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,121
Buttons in AVS

It's questionable if this belongs in the presets subforum or in the AVS forum, but I didn't start this thread only about the preset, but more about the functionality.

A lot of people have already worked this out, but here's my way of doing this:

You don't want the button to flip per frame when you hold the mouse button for multiple frames, what would happen if you would simply use button=getkbmouse(3); I solved this by generating a pulse when the mouse-button is pressed.

This pulse normally would only trigger the button for 1 frame. You want it to switch per pulse. Here's how I solved it all (button is reg02).

code:

xm=getkbmouse(1);
ym=getkbmouse(2);
rm=getkbmouse(3);
mc=if(below(xm,-.9)&above(xm,-1)&above(ym,.9)&below(ym,1)&rm,1,0);
mcpulse=if(equal(mcold,mcnew),0,if(equal(mcold,0),1,0));
mcold=var;
var=if(equal(mc,0),mcpulse,1);
mcnew=var;
mcswitch=if(mcpulse,bnot(mcswitch),mcswitch);
reg02=mcswitch;



Example preset is attached (will most likely be in my new pack).
The button appears when you move the mouse over the left and bottom of the preset ( xpos < -0.9 or ypos < 0.9 ) Click it and the preset changes. Also explained in the comment.
Attached Files
File Type: zip wotl - oil grease is not black.zip (1.6 KB, 130 views)

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump