Urgent: Using Layers

Discuss any general programming issues here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Urgent: Using Layers

Post by djrikki »

Hi,

I am trying to use the command CreateLayer, problem is I cannot get rid of the background colour.

CreateDisplay(1, {Color = #YELLOW)
CreateLayer(10,10,240,70, {Color = #BLACK, Mask, Layers = True} )
SelectLayer(1)
Cls()
SetFontColor(#RED)
TextOut(#CENTER,#CENTER,"hello")
EndSelect()
OpenDisplay(1)
ShowLayer(1)
Wait(200)

How do I get this simple example to simply show Red Text sat on a yellow display?

Require an answer asap... tonight would help!!
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
jalih
Posts: 276
Joined: Fri Jun 18, 2010 8:08 pm
Location: Finland

Re: Urgent: Using Layers

Post by jalih »

Some simple example on basic layer usage... Hope it helps!

Example just creates two layers: "HelloBox" and "HelloText" and does something with them.

Code: Select all

@DISPLAY {Width = 640, Height = 480, Title = "Simple Layer test"}

EnableLayers()

SetFillStyle(#FILLCOLOR)
Box(#CENTER, #CENTER, 300, 200, #RED, { Name = "HelloBox", AnchorX = 0.5, AnchorY = 0.5, RoundLevel = 25, Hidden = True })
SelectLayer("HelloBox")
SetFont(#SANS, 50)
SetFontColor(#WHITE)
SetFontStyle(#ANTIALIAS)
TextOut(#CENTER, #CENTER, "Hello World!")
EndSelect()

SetFont(#SANS, 54)
SetFontColor(#RED)
TextOut(#CENTER, #CENTER, "Hello World!", { Name = "HelloText", AnchorX = 0.5, AnchorY = 0.5, Hidden = True })

ShowLayer("HelloBox", #CENTER, #TOPOUT)
ShowLayer("HelloText",  #CENTER, #TOPOUT) 

Local ang = 0
Local transp = 0
Local dtransp = 2
Local y = -200

Repeat
	y = y + 2
	y = Wrap(y, -200, 680)
	ang = ang + 2
	ang = Wrap(ang, 0, 360)
	transp = transp + dtransp
	If transp >= 255 Or transp <= 0 Then dtransp = -dtransp

	VWait()
	SetLayerStyle("HelloBox", { Y = y, Rotate = ang, Transparency = transp}) 
	SetLayerStyle("HelloText", { Y = y } )  
Forever
Post Reply