TextButton()
Author: Viltzu
        Added: 9. huhtikuuta 2011 kello 21.06
        Edited: 15. huhtikuuta 2011 kello 22.19
        Category: Käyttöliittymä
    
Description
Luo painettavan tekstin. Kun hiiri ei ole tekstin päällä, väri on nykyisistä piirtoväreistä puolet.
    Code
Select all1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  | Function TextButton(X, Y, T$)
    If MouseX()>X And MouseX()<X+TextWidth(T) And MouseY()>Y And MouseY()<Y+TextHeight(T) Then
        Text X,Y,T
        Return MouseHit(1)
    Else
        r = GetRGB(RED) : g = getRGB(GREEN) : b = getRGB(BLUE)
        Color r/2, g/2, b/2
        Text X,Y,T
        Color r, g, b
    EndIf
EndFunction
//Esimerkki käytöstä
Repeat
    Color 255,125,0
    If TextButton(20,20,"Hello World!") Then MakeError "Memory Access Violation"
    If TextButton(20,30,"^^^^^^^^^^^^") Then End
    DrawScreen
Forever
 | 
Comments
No comments. You can be first!
Leave a comment
            You must be logged in to comment.