CodeBase - Phase-Press Button

Return to the CodeBase listing

Category: Complete Applications

Version: 1.0

0
0

Information

Uploaded: 16th Oct 2009 19:00

Modified: 1st Jan 1970 01:00

Author:  Four Dimensional

Summary

A program demonstrating a custom, user-friendly button. <function open for change and personal use.>

Full Description

This code is best viewed from the editor of DarkBASIC Professional.<br /> <br /> This program shows how to create a button that is very user-friendly:<br /> -It allows you to click while within its boundaries, then change your mind and move outside while the mouse button remains pressed.<br /> -It does not activate when holding down the mouse and randomly moving over it.<br /> -And, it lights up and indents to show when you are about to activate it.<br /> <br /> You may even change the function to paste images rather than create boxes. When using the function, you need to create the button's placeholder to go under and a text or symbol to go over(so in order, placeholder -&gt; button -&gt; text/symbol).<br /> <br /> The function requires you to also build an array titled 'ButtonData' with dimensions (x,2), where x is the number of buttons you will use. Yes, 0 is a valid button.<br /> <br /> The Array allows you to monitor the button's variables, phase and active.<br /> -Phase allows you to change to symbol and button according to when the mouse is 'not over'(0), 'over'(1), 'clicked'(2), and 'released'(3).<br /> -Active tells you if the button has been activated(1) for one frame, else 0.

Comments

No comments yet.