| |
|
|
p.specht
| there's Yes programs, where Schaltflächen not rechtwinkelig are, separate z.B. Polygone. These can always in a crowd Dreiecke decompose, for one then right simply INNEN and OUTER detect can. self-evident there in the windows-API ditto suitable Opportunities - here against it goes it only time um´s principle:
Window Title "Maus in the Dreieck?":cls
declare x!,y!,x1!,y1!,x2!,y2!,x3!,y3!
x1!=240:y1!=40: x2!=400:y2!=200: x3!=240:y3!=300
proc PTEST : parameters x!,y!
declare fab!,fca!,fbc!
fAB!=(y!-y1!)*(x2!-x1!)-(x!-x1!)*(y2!-y1!)
fCA!=(y!-y3!)*(x1!-x3!)-(x!-x3!)*(y1!-y3!)
fBC!=(y!-y2!)*(x3!-x2!)-(x!-x2!)*(y3!-y2!)
return ((fAB!*fBC!)>0) & ((fBC!*fCA!)>0)
endproc
proc TRIANG : parameters x1!,y1!,x2!,y2!,x3!,y3!
usepen 0,1,@rgb(255,0,0):line x1!,y1!-x2!,y2!
line x2!,y2!-x3!,y3!:line x3!,y3!-x1!,y1!
endproc
triang(x1!,y1!,x2!,y2!,x3!,y3!)' Init
print:print "ESC exits.": Print : print "Your mouse is now..."
WHILENOT %Key=27:settimer 100:WaitInput'Main
x!=%MouseX:y!=%Mousey
IF PTest(x!,y!):Locate 10,10:Print "Innen "
ELSE:Locate 10,10:Print "Aussen":ENDIF
ENDWHILE'Exit
killtimer
End
|
|
|
| XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 04/12/21 ▲ |
|
|
|