Post Reply 
MOUSE returns Invalid Input
12-16-2013, 08:38 AM
Post: #7
RE: MOUSE returns Invalid Input
hello

have a look at this code

Code:

Colors= { #FF0000h, #FF00h, #FFh, #FF00FFh }; // pre defined color list
EXPORT FOURSQUARE()
BEGIN
 while 1 do
  RECT();
  RECT_P(0,0,318,200);
  RECT_P(0,201,318,218,0);
  TEXTOUT_P("EXIT",130,218,3,RGB(255,255,255));
  local l:=WAIT(-1); // wait for a user input
  IF TYPE(l)=6 and l(1)=#0 THEN // verify that we have a list corresponding to a mouse down...
   local mx:=l(2)/#160d, my:=l(3)/#100d; // x and y for the rectangle (0 or 1 in each case!)
   if my>=2 then return "DONE"; end; // well, or maybe 2!!!!
   rect_p(mx*#160d, my*#100d, mx*#160d+#160d, my*#100d+#100d, Colors(mx*2+my+1)); // draw the rectangle
   wait(0.2); // wait so we see it!
  END;
 end; 
END;

cyrille
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: MOUSE returns Invalid Input - Han - 12-14-2013, 09:16 PM
RE: MOUSE returns Invalid Input - Damien - 12-14-2013, 10:53 PM
RE: MOUSE returns Invalid Input - cyrille de brébisson - 12-16-2013 08:38 AM
RE: MOUSE returns Invalid Input - Snorre - 12-20-2013, 04:34 PM



User(s) browsing this thread: 1 Guest(s)