Topic:   Hey Al   (Read 20206 times)


0 Members and 1 Guest are viewing this topic.

GuthanSoftware


  • GMG-er

  • **


  • Posts: 105

  • GuthanSoftware
Hey Al
« on: November 05, 2009, 03:47:04 PM »
I had an idea for Gm 4. It's that you should have If Mouseover Then [code here]
It would be nice to have :p
Stupid Test Creator
Sim School Creator
Windox Creator
and more

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Hey Al
« Reply #1 on: November 05, 2009, 05:48:45 PM »
Here's how I do it:

Code: [Select]
'--- Set the pixel dimensions of area 1.
area1Top = 100
area1Bottom = 250
area1Left = 100
area1Right = 250


ON TIMER 1
  selectedArea = 0

  '--- Check if the mouse is over area 1.
  IF mouseHorz => area1Left THEN
    IF mouseHorz =< area1Right THEN
      IF mouseVert => area1Top THEN
        IF mouseVert =< area1Bottom THEN

          '--- Code to be executed while the mouse is over area 1.
          selectedArea = 1
          CLEAR TEXT
          PRINT The mouse is over the area, thus this text is visible.

        END IF
      END IF
    END IF
  END IF

  '--- Code to be executed while the mouse isn't over any areas.
  IF selectedArea = 0 THEN CLEAR TEXT

END TIMER

Here's a source file with two examples: http://www.mediafire.com/?hmlnlmyjzjj
I survived the spammage of 2007