SCI Kernel Documentation/Animation Functions

From SCI Wiki
Jump to: navigation, search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Animation Functions

Author: Jeff Stephenson

Revision by: David Slayback

 



Animation Functions


(Animate cast [doCastDoit])

Cast is a kList of members of the cast (Actors, Props, and Views which are on the screen). Animate updates the on-screen views and positions of all members of the cast to correspond to the current state of their properties. doCastDoit can be either the default of TRUE meaning that for each member of the cast, the doit: method will be called, or FALSE, which will allow an animate cycle without the doits called.

If cast is 0, then Animate will dispose lastCast (internal kernel knowledge of the cast during the previous animation cycle) and redraw the picture, if needed.

If a picture has been drawn since the last Animate, the entire screen is updated. Certain bits in the signal properties of the objects allow an object to be erased and removed from the cast or tell Animate to leave the object in the cast but not to update it (in order to gain speed when an object isn't changing).


(CanBeHere actor castElements)

Checks to see that an Actor can be in a certain position. First, CanBeHere checks all pixels in an actor's base rectangle to see if any are on pixels which have the controls specified by actor's illegalBits property. Then, it checks to see if the actor's base rectangle intersects with any other of the casts base rectangle. If either of these are true, CanBeHere returns FALSE, otherwise TRUE.


(InitBresen motion)

Initialize internal state of a motion class for a modified Bresenham line.


(DoBresen motion)

Move an actor one step along the calculated path.


(DoAvoider avoider client motion [skipFactor])

Use avoider to move the client in the given motion, trying to avoid all objects and ignore all illegal controls. If skipFactor is given, the avoider will try to go skipFactor steps in a given move.


(SetJump actor deltaX deltaY gravY)

Compute the initial xStep for a motion of class Jump based on the x and y differences of the start and end points and the force of gravity. This was downcoded from Script to use longs to avoid overflow errors. For most motion (increasing y or x motion comparable to or greater than y motion), we pick equal x & y velocities. For motion which is mainly upward, we pick a y velocity which is n times that of x.


(BaseSetter actor)

Set the actor's base rectangle (brTop, brLeft, brBottom, brRight) based on the y-value of the actor.


(DirLoop actor heading)

Set the loop of the actor based on the actors heading.


(NumLoops actor)

Returns the number of loops in the current view of actor.


(NumCels actor)

Returns the number of cels in the current loop and view of actor.


(SetNowSeen actor)

Set the nowSeen rectangle of actor based on actor's current cel.


(CelWide view loop cel)

Return the width (in pixels) of cel cel of loop loop of view view.


(CelHigh view loop cel)

Return the height (in pixels) of cel cel of loop loop of view view.


(OnControl mapType x y [rx ly])

Return a bit-mapped word which represents the control in where mapType = { VMAP, PMAP, CMAP}, screen at the point (x,y). If the optional rx, ly are specified, the word has the bit set for each control which is within the rectangle (x, y) - (rx, ly).


(DrawCel view loop cel left top priority)

Draw cel cel of loop loop of view view. Put the upper left corner of the cel at (left, top). The cel should be at priority priority.


(AddToPic picViewList)

Will sort the given picViewList based on the y and z properties, and then will draw list of picViews to the picture.

 

Notes


 

Table of Contents

 

< Previous: Save/Restore Game Functions Next: Graphic Screen Functions >