Game Development Reference
In-Depth Information
Figure 10.3
Four control states used with controls.
When the player presses a button on the mouse or controller, the control state
changes from active to pressed. The art for this state usually depicts the control as
pressed downward so that the player can tell what
s going on. If the cursor moves
away from the control, it will change state to active again, giving the player a clue
that if the activation button is released, nothing will happen.
Disabled controls are usually drawn darkened or grayed out, giving the impression
that no one is home. I know that Windows does this all over the place, but there is
one thing about it that really bothers me: I can never tell why the control is disabled.
It
'
'
s fine to have a disabled state, but make sure that the player can figure out why it
'
s
disabled, or you
'
ll just cause a lot of frustration.
Use the Mouse Cursor for User Feedback
If your interface uses a mouse, change the mouse cursor to something different, like a hand icon, when
you are over an active control. This approach will give the player another clue that something will
happen when he clicks the button. Use the Windows LoadCursor() API to grab a handle to the right
mouse cursor and call SetCursor() with the cursor handle. If you want a good package to create
animated mouse pointers, try Microangelo by Impact Software at www.impactsoftware.com.
Don
t get confused about the control states mentioned here and control activation.
Control activation results in a command message that propagates through to the
screen
'
s OnControl() function. For a standard push button control, this only hap-
pens if the mouse button is pressed and released over the button
'
'
s hit area.
More Control Properties
There are some additional properties you can attach to controls, mostly to give the
player a more flexible and informative interface. These properties include hot keys,
tooltips, context-sensitive help, draggability, sounds, and animation.
 
 
Search WWH ::




Custom Search