Old 06-15-2014, 09:16 PM   #1
@non
Human being with feelings
 
Join Date: Aug 2013
Posts: 133
Default *About logic statements and custom toggle

wiki is broken. Please can I get the english of logic statements for cycle actions

just what the commands represent TY
__________________
legal notice(07/2/14)- all posts are personal & ment for reaper.fm members; information collected/disseminated to 3rd partys is in violation of privacy laws;post such (here)Immediately so appropriate penality may be negotiated

Last edited by @non; 06-19-2014 at 03:12 PM.
@non is offline   Reply With Quote
Old 06-18-2014, 01:04 PM   #2
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 766
Default

This is some basic logic for mouse over and toggle. Don't know the string code off the top of my head, but hopefully this gets you at least part of the way there.

Code:
@init

boxwidth = 100;
boxheight = 100;
box_x = 50;
box_y = 50;
box_hover_toggle = 1;
box_hover = 0;

@gfx

(mouse_x < (box_x + box_width)) && (mouse_x > box_x) ? (
  (mouse_y < (box_y + box_height)) && (mouse_y > box_y) ? (
    box_hover = 1;
    box_hover_toggle ? (

      // your mouse enters the box area for the first time

      box_hover_toggle = 0;
      ) : (

      // after your mouse enters box area

      ); // end of hover_toggle
    ); // end of y check
  ) : (
    box_hover = 0;
  );  // end of x check


!box_hover ? (

  // your mouse is outside of the box

  );
SaulT is offline   Reply With Quote
Old 06-18-2014, 01:13 PM   #3
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,415
Default

*Actually I'm not sure what your question is.....



BUt...

I use this mouse function for toggling stuff...

Code:
function mouse_click(cap)local(i)//used for ON / OFF type states
  (mouse_cap == cap ? i+=1 : i=0; i == 1 ? 1 : 0;
  );
an is mouse in rectangle ? function
Code:
function mouse_in_rect(x,y,w,h)//return 1 if yes, 0 if no
  (mouse_x > x && mouse_x < x+w && mouse_y > y && mouse_y < y+h ? 1 : 0;
  );//

make a button at x,y with w,h. put those functions together... lets assume your button toggles slider(x) from 0 and 1...

Code:
mouse_in_rect(x,y,w,h) && Mouse_click(1) ? 
     slider(x)==0 ?  slider(x)==1: slider(x)==0;
there are several ways to do this, but this seems to me the most straightforward and creates NO extra variables.

Last edited by James HE; 06-18-2014 at 01:22 PM.
James HE is offline   Reply With Quote
Reply

Thread Tools
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


All times are GMT -7. The time now is 08:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.