Class Documentation

Name:Reflection
Version:1.0
ID:ID_REFLECTION
Status:Beta
Category:Effect
Date:July 2003
Author:Rocklyte Systems
Copyright:  Rocklyte Systems (c) 2003. All rights reserved.
Short:  Creates water reflections in real time.



Description

The Reflection class draws an animated effect that emulates the appearance of reflected water. Although it may appear complex, the reflection algorithm uses a simple line copying technique, at very little cost to the CPU. This makes it an excellent effect to use when an animation is required that isn't going to be a burden on the system.

Once initialised, the effect will run automatically until the object is freed from the system.

Structure

The Reflection object consists of the following public fields:

Height  The height of the ripple graphic is specified here.
Opacity  Determines the level of translucency applied to the reflection.
Speed  The speed at which the reflection vertically shifts can be altered in this field.
WaterLevel  Determines the level at which the water reflection starts.
Width  The width of the ripple graphic is specified here.
XCoord  Defines the horizontal position of the ripple graphic.
XOffset  Defines the horizontal offset of the ripple graphic.
YCoord  Defines the vertical position of the ripple graphic.
YOffset  Defines the vertical offset of the ripple graphic.
Field:Height
Short:The height of the ripple graphic is specified here.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

If a ripple graphic is to be limited to a specific drawable area, set this field to limit the clipping height. A percentage may be specified if the FD_PERCENT flag is used when setting the field.


Field:Opacity
Short:Determines the level of translucency applied to the reflection.
Type:FLOAT/PERCENTAGE
Status:Get/Set

This field determines the translucency level of the reflected water. The default setting is 100%, which means that the reflection will be solid. Any other value that you set here will alter the impact of the reflection over the destination drawable.

Please note that the use of translucency will always have an impact on the time it normally takes to draw the reflection.


Field:Speed
Short:The speed at which the reflection vertically shifts can be altered in this field.
Type:LONG
Status:Read/Set

To later the speed at which the reflection moves, you can write values to this field. Lower values will increase the speed and higher values will lower it. The recommended speed setting is 24.


Field:WaterLevel
Short:Determines the level at which the water reflection starts.
Type:FLOAT/PERCENTAGE
Status:Read/Set

The level at which the reflected water starts can be altered by writing to this field. The default, minimum value is 50%. Increasing the value will lower the water level (so a setting of 75% will fill 25% of the graphics space with water). The maximum value is 95%.


Field:Width
Short:The width of the ripple graphic is specified here.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

If a ripple graphic is to be limited to a specific drawable area, set this field to limit the clipping width. A percentage may be specified if the FD_PERCENT flag is used when setting the field.


Field:XCoord
Short:Defines the horizontal position of the ripple graphic.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

The horizontal position of an image can be set to an absolute or relative coordinate by writing a value to the XCoord field. To set a relative/percentage based value, you must use the FD_PERCENT flag or the value will be interpreted as fixed. Negative values are permitted.


Field:XOffset
Short:Defines the horizontal offset of the ripple graphic.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

The XOffset has a dual purpose depending on whether or not it is set in conjunction with an X coordinate or a Width based field.

If set in conjunction with an X coordinate then the image will be drawn from that X coordinate up to the width of the container, minus the value given in the XOffset. This means that the width of the image is dynamically calculated in relation to the width of the container.

If the XOffset field is set in conjunction with a fixed or relative width then the image will be drawn at an X coordinate calculated from the formula "XCoord = ContainerWidth - ReflectionWidth - XOffset".


Field:YCoord
Short:Defines the vertical position of the ripple graphic.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

The vertical position of an image can be set to an absolute or relative coordinate by writing a value to the YCoord field. To set a relative/percentage based value, you must use the FD_PERCENT flag or the value will be interpreted as fixed. Negative values are permitted.


Field:YOffset
Short:Defines the vertical offset of the ripple graphic.
Type:DOUBLE/PERCENTAGE
Status:Get/Set

The YOffset has a dual purpose depending on whether or not it is set in conjunction with a Y coordinate or a Height based field.

If set in conjunction with a Y coordinate then the image will be drawn from that Y coordinate up to the height of the container, minus the value given in the YOffset. This means that the height of the ripple is dynamically calculated in relation to the height of the container.

If the YOffset field is set in conjunction with a fixed or relative height then the image will be drawn at a Y coordinate calculated from the formula "YCoord = ContainerHeight - Height - YOffset".