Simple Button Class

Monkey Forums/Monkey Code/Simple Button Class

xzess(Posted 2011) [#1]
Here is a simple Button Class

Usage:
Method OnCreate()
local TestButton:= new Button
TestButton.Create("Button.png","ButtonClick.png",20,10,"clicksnd.wav")
End
	
Method OnUpdate()
TestButton.Update()
End
	
Method OnRender()
If TestButton.Visible = True
DrawImage(TestButton.CurrentImage,TestButton.PositionX,TestButton.PositionY)
End

End

Maybe i will post my ViewManager Class also here, but for now you can workaround by adding each Button to the render and update manually.



Im really looking for some solution to add a callbackfunction parameter on the Create Method or better: to realise a Callback in Monkey


xzess(Posted 2011) [#2]
note: sorry, found the edit function after posting this


found this one:
http://blitzmax.com/Community/posts.php?topic=94283#1081689