Difference between revisions of "SCI Kernel Documentation/Animation Functions"
(Created page with "Official SCI Documentation<br /> <div align="center"> Chapter: 1 | 2 | SCI...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
[[SCI Kernel Documentation/String Functions|6]] | | [[SCI Kernel Documentation/String Functions|6]] | | ||
[[SCI Kernel Documentation/Picture Functions|7]] | | [[SCI Kernel Documentation/Picture Functions|7]] | | ||
− | [[SCI Kernel Documentation/Save | + | [[SCI Kernel Documentation/Save-Restore Game Functions|8]] | |
[[SCI Kernel Documentation/Animation Functions|9]] | | [[SCI Kernel Documentation/Animation Functions|9]] | | ||
[[SCI Kernel Documentation/Graphic Screen Functions|10]] | | [[SCI Kernel Documentation/Graphic Screen Functions|10]] | | ||
Line 23: | Line 23: | ||
</div><br /> | </div><br /> | ||
− | <div align="center"><span style="font-size: 22pt"></span><br /> | + | <div align="center"><span style="font-size: 22pt">Animation Functions</span><br /> |
''Author: [[Jeff Stephenson]]''<br /> | ''Author: [[Jeff Stephenson]]''<br /> | ||
''Revision by: David Slayback''</div> | ''Revision by: David Slayback''</div> | ||
Line 29: | Line 29: | ||
| | ||
− | + | ||
+ | ==<br /> Animation Functions == | ||
+ | |||
+ | ===<br /> (Animate cast [doCastDoit]) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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). | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CanBeHere actor castElements) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (InitBresen motion) === | ||
+ | |||
+ | <blockquote> | ||
+ | Initialize internal state of a motion class for a modified Bresenham line. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DoBresen motion) === | ||
+ | |||
+ | <blockquote> | ||
+ | Move an actor one step along the calculated path. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DoAvoider avoider client motion [skipFactor]) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SetJump actor deltaX deltaY gravY) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (BaseSetter actor) === | ||
+ | |||
+ | <blockquote> | ||
+ | Set the actor's base rectangle (brTop, brLeft, brBottom, brRight) based on the y-value of the actor. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DirLoop actor heading) === | ||
+ | |||
+ | <blockquote> | ||
+ | Set the loop of the actor based on the actors heading. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (NumLoops actor) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns the number of loops in the current view of actor. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (NumCels actor) === | ||
+ | |||
+ | <blockquote> | ||
+ | Returns the number of cels in the current loop and view of actor. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (SetNowSeen actor) === | ||
+ | |||
+ | <blockquote> | ||
+ | Set the nowSeen rectangle of actor based on actor's current cel. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CelWide view loop cel) === | ||
+ | |||
+ | <blockquote> | ||
+ | Return the width (in pixels) of cel cel of loop loop of view view. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (CelHigh view loop cel) === | ||
+ | |||
+ | <blockquote> | ||
+ | Return the height (in pixels) of cel cel of loop loop of view view. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (OnControl mapType x y [rx ly]) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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). | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (DrawCel view loop cel left top priority) === | ||
+ | |||
+ | <blockquote> | ||
+ | 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. | ||
+ | </blockquote> | ||
+ | |||
+ | ===<br /> (AddToPic picViewList) === | ||
+ | |||
+ | <blockquote> | ||
+ | Will sort the given picViewList based on the y and z properties, and then will draw list of picViews to the picture. | ||
+ | </blockquote> | ||
| | ||
Line 42: | Line 143: | ||
| | ||
− | <span style="float: left">[[SCI Kernel Documentation/|< Previous: ]]</span><span style="float: right">[[SCI Kernel Documentation/|Next: | + | <span style="float: left">[[SCI Kernel Documentation/Save-Restore Game Functions|< Previous: Save/Restore Game Functions]]</span> |
+ | <span style="float: right">[[SCI Kernel Documentation/Graphic Screen Functions|Next: Graphic Screen Functions >]]</span> | ||
| | ||
[[Category:SCI Documentation]] | [[Category:SCI Documentation]] | ||
− | |||
[[Category:Kernel Functions]] | [[Category:Kernel Functions]] | ||
+ | [[Category:Animation]] | ||
+ | [[Category:Animation Functions]] |
Latest revision as of 13:14, 3 December 2015
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
< Previous: Save/Restore Game Functions Next: Graphic Screen Functions >