07-26-2024, 06:00 AM
Here is something I whipped up real quick to give you an idea of how to accomplish this.
Code: (Select All)
Inputbox = _NEWIMAGE(300, 100, 32)
_DEST Inputbox
CLS , _RGB32(255, 255, 255)
LINE (5, 5)-(294, 94), _RGB32(127, 127, 127), BF
' YES button
LINE (50, 55)-(100, 85), _RGB32(192, 192, 192), BF
LINE (52, 57)-(98, 83), _RGB32(64, 64, 64), BF
' NO button
LINE (200, 55)-(250, 85), _RGB32(192, 192, 192), BF
LINE (202, 57)-(248, 83), _RGB32(64, 64, 64), BF
' text
COLOR _RGB32(255, 255, 255), _RGB32(127, 127, 127)
LOCATE 2, 11: PRINT "Pete For President?";
COLOR _RGB32(255, 255, 255), _RGB32(64, 64, 64)
LOCATE 5, 9: PRINT "YES";
LOCATE 5, 28: PRINT "NO";
SCREEN _NEWIMAGE(640, 480, 32)
CLS
FOR i = 10 TO 640 STEP 20 ' awesome background
FOR j = 10 TO 480 STEP 20
CIRCLE (i, j), 10
NEXT j, i
SLEEP 2
PCOPY 0, 1 ' save current screen
Frames = 0
Answer$ = ""
DO ' display inputbox and get input
_LIMIT 10
WHILE _MOUSEINPUT: WEND
_PUTIMAGE (170, 100), Inputbox ' restore inputbox image
x = _MOUSEX: y = _MOUSEY
IF x >= 220 AND x <= 270 AND y >= 155 AND y <= 185 THEN ' mouse over YES button
LINE (220, 155)-(270, 185), _RGB32(0, 0, 0), B
IF _MOUSEBUTTON(1) THEN Answer$ = "YES"
END IF
IF x >= 370 AND x <= 420 AND y >= 155 AND y <= 185 THEN ' mouse over NO button
LINE (370, 155)-(420, 185), _RGB32(0, 0, 0), B
IF _MOUSEBUTTON(1) THEN Answer$ = "NO"
END IF
Frames = Frames + 1
_DISPLAY
LOOP UNTIL Answer$ <> "" OR Frames = 50 ' 5 second timer
_AUTODISPLAY
PCOPY 1, 0 ' restore screen
IF Frames = 50 THEN Answer$ = "YES"
SLEEP 2
CLS
PRINT
PRINT " The chosen button was "; Answer$