<

LESSON 4 - Part 1:  Graphic States, Sprites & Draw Groups

The Second Method (continued)

Click OK, and then look to your sections area. Your TTAs section was created automatically for you once the menu was built.


Fig. 1.39

Next, we'll take care of the object properties as this is very important. Without modifying the properties, our graphic states will not show up.

Go back to the OBJD section. Find the line where it says Tree table and insert 104 there. Then skip down to where it says number of graphics and insert 4 in there (original + 3).

Before we go any further, let's stop right here, save your work, exit out of IFF and go recolor your end tables. After recoloring, we'll come back to the lesson to finish up our coding.


To continue with our lesson, open up IFF, bring up your end table and go to the BHAV section. Our graphic states are called via the object's attributes and since our end table did not hav a TTA or TTBA section, there were no attributes defined within the object. We must then, therefore, define attributes.

Go to the BHAV section and add a Behavior. The behavior should be called "Set Attributes" and the behavior number will be #4118. Double click your new behavior and as we build the code, I want you to pay particular attention to the returns. Also, some of you will feel inclined to duplicate lines, and while duplicating is acceptable, I want you to humor me and write each line out. Writing out each line will help you to understand what it is that you are doing as far as the returns go. Here we go.

Add 2 lines. For the first line, statement #0, our Data box will be:

Function:  2
True line:  1
False line:  2
Param 1:  0
Param 2:  0
Param 3:  512
Param 4:  1795

Statement #1:

Function:  2
True line:  True
False line:  Error
Param 1:  0
Param 2:  0
Param 3:  1280
Param 4:  1792

Take a good look at what these lines are saying, and notice that statement 2 returning in True/Error ends the first graphic state's definition.