Login Register
Frontpage Code library Pastebin

drawTextLink

Author: djfilbe
Added: 20. kesäkuuta 2011 kello 16.36
Edited: 20. kesäkuuta 2011 kello 16.36
Category: Käyttöliittymä

Description

Luo linkin, jota voi painaa. Voidaan luoda linkkejä WWW-sivuille tai Windows-komentoja.

Code

Select all
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Repeat
	drawTextLink("Kuukkeli", "http://google.fi", ScreenWidth()-MouseX(), ScreenHeight()-MouseY())
	Drawscreen
Forever



Function drawTextLink(otsikko$, osoite$, x, y, a=0, margin=1)
	r=getRGB(1)
	g=getRGB(2)
	b=getRGB(3)
	If _linkBackground And a = 0 Then
		DrawImage _linkBackground, x,y
	ElseIf a = 0 Then
		Color cbWhite
		Box x,y,TextWidth(otsikko)+margin*2,TextHeight(otsikko)+margin*2
	Else // jos a=1 (läpinäkyvä tausta)
		
	EndIf
	Color cbDarkBlue
	Text x+margin, y+margin, otsikko
	Color r,g,b
	If MouseUp(1) And BoxOverlap(x,y,TextWidth(otsikko)+margin*2,TextHeight(otsikko)+margin*2, MouseX(), MouseY(), 1,1) Then Execute osoite
EndFunction

Comments

#13 Sent by: VesQ, 15. heinäkuuta 2011 kello 15.40

Mitä ihmettä tuo _linkBackground juttu tekee tuolla? Eihän sitä aseteta missään!

#24 Sent by: skorpioni_cb, 4. tammikuuta 2012 kello 11.05

Ei voi tietää?

Leave a comment

You must be logged in to comment.