Radiobutton macro – Apple Shake 4 User Manual

Page 999

Advertising
background image

Chapter 32

The Cookbook

999

RadioButton Macro

This macro is used to create those swell radio buttons. You typically use this only in
command-line mode, as it does some automatic output file naming for you. The first
step is to create and specify a directory where you want to place the icons. This is
typically $HOME/nreal/icons/ux/radio, as they tend to pile up, but you can place them
anywhere.

Open the radiobutton.h file and look for the filePath declaration, line 6 below:

image RadioButton(

const char *text=“linear”,
// lengths are 74, 37, 53
int length = 74,
string fileName=text,
string filePath=“$HOME/nreal/icons/ux/radio/”,
int branch=time,

...

Make sure that directory exists. The standard image lengths are 37, 53, and 74 pixels
long. The shortest you can practically do is 19.

Finally, it calls on the font Arial. If you do not have this font, search for the word and
substitute an appropriate font.

The parameters are:

“text”: You can type it, or if you want more than one word, enclose it in “quotation
marks.”

length: Output pixel width. Standard lengths are 37, 53, and 74 pixels.

fileName: “text” by default. The macro appends .on.nri, on.focus.nri, .off.nri, and
.off.focus.nri for frames 1, 2, 3, and 4.

filePath: Redirect the output directory without editing the file.

xScale: Scale the text on the X axis if you have to squeeze the letters a bit. The
default is 1.

zoom: Creates a button 19 pixels high by default, but you can scale it up. The default
value is .25.

branch: Specifies the state you want the macro. Normally you do not have to touch
this, you just change the frame number, to which this parameter is set.

1 = on

2 = on + focus

3 = off

4 = off + focus

Advertising