English
Source / code snippets

Dreieck as mouse-Schaltfläche (demonstration in reinem XProfan-11.2a free)

 

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 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
04/12/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

660 Views

Untitledvor 0 min.
N.Art07/23/21
Glubbfan06/19/21
Uwe ''Pascal'' Niemeier06/13/21
Walter04/25/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie