Help with GUI

Blitz3D Forums/Blitz3D Programming/Help with GUI

Write a function which does the following:
And simply call the function each time you wish to create
a button.

Ie NewButton("ButtonUp.jpg","ButtonOver.jpg",0,0,1,1) as an example..

Function NewButton(ImageName1$,ImageName2$,X#,Y#,Scalex#,ScaleY#)

Button.button_type=new button_type



Button\image1=LoadImage(ImageName1$)
Button\image2=LoadImage(ImageName2$)
Button\x#=x
Button\y#=y
Button\scalex#=ScaleX
Button\scaley#=ScaleY
Button\width#=ImageWidth(Button\image1)
Button\height#=ImageHeight(Button\image1


end function