Class Documentation

Name:Starfield
Version:1.0
ID:ID_STARFIELD
Status:Stable
Category:Effect
Date:February 2001
Author:Rocklyte Systems
Copyright:  Rocklyte Systems (c) 2000-2001. All rights reserved.
Short:  This class creates a real-time animated starfield.



Description

The Starfield class displays a zooming starfield, a classic effect often used in older graphics demonstrations. When creating a Starfield object, you must make sure that it is contained by a graphical object area (e.g. that provided by a Render object). Another graphical object should also be used to define the background underneath the Starfield. Here is an example:

  <render width="300" height="200"/>
    <box colour="#000000"/>
    <starfield maxelements="1000"/>
  </render>

Once initialised, the Starfield will run automatically until it is freed from the system. The amount of processor cycles used by the Starfield is directly proportional to the amount of requested stars, as specified by the MaxElements field. Generally, 500 to 1000 stars is sufficient for an adequate effect and minimal processor usage.

Structure

The Starfield object consists of the following public fields:

MaxElements  The total number of stars is defined by this field.
XOffset  The horizontal location of the Starfield's center.
YOffset  The vertical location of the Starfield's center.
Field:MaxElements
Short:The total number of stars is defined by this field.
Type:LONG
Status:Read/Init

You may specify the exact amount of stars to be used in the Starfield by setting the MaxElements field. For a reasonable effect, a minimum amount of 500 stars is recommended. The value should be no higher than 5000.

If you do not set this field, the default number of stars will be used.


Field:XOffset
Short:The horizontal location of the Starfield's center.
Type:LONG
Status:Read/Write

By default this field is set to zero, which puts the horizontal location of the Starfield at the center of its container. You can manipulate the horizontal center of the Starfield by writing directly to this field. Negative values will move the Starfield to the left, positive values will move it to the right.


Field:YOffset
Short:The vertical location of the Starfield's center.
Type:LONG
Status:Read/Write

By default this field is set to zero, which puts the vertical location of the Starfield at the center of its container. You can manipulate the vertical center of the Starfield by writing directly to this field. Negative values will move the Starfield up, positive values will move it down.