; ID: 1636 ; Author: Fernhout ; Date: 2006-03-07 14:29:38 ; Title: Button3D ; Description: 3D look button ;****************************************************************************** ;* Button3D. Version 1.00 * ;* Created: march 2006 * ;* Created by: Bart Fernhout. * ;****************************************************************************** ;* Description * ;* Create a button in a 3D look. Its drawing on the backbuffer screen. * ;* Then it wil be fliped to the front. The 3D colors is given during the call * ;* to this function. The function gives a true back if the button is released * ;* color 2 for button pressed is given in the input. Button down is color * ;* 2 and 3 swaped. Call of the function is a follow: * ;* Button3D (Xpos_LeftUp,Ypos_LeftUP,WithButton,HeihtButton,Color1,Color2, _ * ;* Color3,Color4,Color5,Text) * ;* Color 1 = button color * ;* Color 2 = Left And Up side of button * ;* Color 3 = Right and down side color of the button * ;* Color 4 = Button down color * ;* Color 5 = Text color * ;* * ;* NOTE: Even if the placing of the button is outside the visual screen there * ;* will be no checking for this. * ;* * ;* The text font is used by the standard font what is used in the program. * ;* to change the font do this in the main program. And change back after * ;* call of this program. Font color is not changed * ;****************************************************************************** ;* * * * ;* Extra in main program include is SetColors_inc.BB ;* * * * Function Button3D (XposButton,YposButton,ButWith,ButHeight,Col1$,Col2$,Col3$,Col4$,Col5$,ButText$) ;Make sure the back buffer is the target. ; Side colors Col20$ = Col2$ Col30$ = Col3$ ; Button color Col10$ = Col1$ Col40$ = Col4$ ; now everything what was visable is in the drawing area. ; And make a repeating area so the swapping of the button is always on screen Repeat ;Flip ; Check if the mouse button left is down then swap colors If (MouseX()>XposButton And MouseX()YposButton And MouseY()XposButton And MouseX()YposButton And MouseY()XposButton And MouseX()YposButton And MouseY()