Difference between revisions of "Script Classes for Adventure Games/Feature Class"

From SCI Wiki
Jump to navigationJump to search
Line 39: Line 39:
 
 
 
 
  
xxxxxxx body xxxxxxxx
+
==<br /> The Feature Class ==
 +
 
 +
The Feature class is simply a location on the the screen that has . handleEvent method. This is used when an object that should have . response to events is drawn into the picture. If the global variable useSortedFeatures is TRUE all elements of the cast and features will receive the event in the order of their proximity to ego.
 +
 
 +
{|
 +
|width= "125"|In file:||actor.sc
 +
|-
 +
|Inherits from:||Object
 +
|-
 +
|Inherited by:||View
 +
|-
 +
|            ||PicView
 +
|}
 +
 
 +
===<br /> Properties ===
 +
 
 +
<blockquote>
 +
{|
 +
|width= "125"|x
 +
|-
 +
|y
 +
|-
 +
|z ||The position on the screen.
 +
 
 +
The x property should be set to the x coordinate of the object on the screen. The y property should be set to the y coordinate of the objects projection onto the ground if it is elevated, otherwise it's y coordinate on the screen. If the object is elevated above the ground then the amount of elevation should be placed in the z property.
 +
</blockquote>
 +
 
 +
===<br /> Methods ===
 +
 
 +
====<br /> handleEvent:event ====
 +
<blockquote>All elements of the EventHandler features receive the handleEvent message. If the feature is to receive events it should be added to the current rooms features list via the rooms setFeatures method. (i.e.) (curRoom setFeature:myFeature)
 +
 
 +
This is generally done in the init method of a room. If the global variable useSortedFeatures is TRUE all elements of the features list and the cast will receive the handleEvent message in the order of their proximity to ego.</blockquote>
  
 
&nbsp;
 
&nbsp;

Revision as of 23:38, 10 December 2015

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Index


The Feature Class

Author: Jeff Stephenson

Date: 5 April 1988

 


The Feature Class

The Feature class is simply a location on the the screen that has . handleEvent method. This is used when an object that should have . response to events is drawn into the picture. If the global variable useSortedFeatures is TRUE all elements of the cast and features will receive the event in the order of their proximity to ego.

In file: actor.sc
Inherits from: Object
Inherited by: View
PicView


Properties

x
y
z The position on the screen.

The x property should be set to the x coordinate of the object on the screen. The y property should be set to the y coordinate of the objects projection onto the ground if it is elevated, otherwise it's y coordinate on the screen. If the object is elevated above the ground then the amount of elevation should be placed in the z property.


Methods


handleEvent:event

All elements of the EventHandler features receive the handleEvent message. If the feature is to receive events it should be added to the current rooms features list via the rooms setFeatures method. (i.e.) (curRoom setFeature:myFeature) This is generally done in the init method of a room. If the global variable useSortedFeatures is TRUE all elements of the features list and the cast will receive the handleEvent message in the order of their proximity to ego.

 

Notes


 

Table of Contents

 

< Previous: The Timer Class Next: The View Class >