Game Development Reference
Figure 2-53. Choose a font and type some text.
You're now ready to design the button's Over and Down states.
Understanding button states
You'll notice the words Up , Over , Down and Hit in the button's timeline. They refer to what's known as
the button's state . Each state has its own frame.
Understanding a button's state is really very simple. The Up state frame shows what the button looks like
when it is not being pressed while it is still waiting for the user to click it. The Over state frame shows
how the button looks when the mouse is hovering over it, just before the user clicks it. Usually button
designers will create some sort of highlighting effect in the Over state, almost as if the button were say-
ing, “Click me! Click me!” The Down state frame shows what the button looks like when the user actually
clicks it. Designers will often create an illusion of the button being actually physically pressed down to
create a sense of tactile feedback. You'll see all of these button states in use very soon.
The odd one out here is the Hit state frame. The Hit frame defines the area of the but-
ton that is actually sensitive to the mouse. If you have a really small button, or one
made up of irregular shapes or plain text, you could give the button a large rectangu-
lar Hit state to make it easier for the user to click. Interestingly, whatever you draw in
the Hit state doesn't display on the screen. That means that you can leave all the other
states blank and just create a Hit state to make an invisible button . Invisible buttons
have a lot of potential for certain types of point-and-click adventure games, in which
you might want to give certain areas of your scene button-like sensitivity, but not have
them look or behave like buttons. You won't need to use the Hit state in any of the
examples in this topic, but it's important to keep in mind what it's used for. If you don't
define a Hit state, the button's Up state is used as the area sensitive to the mouse.