VisualComponent Class Reference

#include <VisualComponent.h>

Inheritance diagram for VisualComponent:
Component Sprite Wireframe BgmapSprite ObjectSprite ObjectSpriteContainer Asterisk Line Mesh Sphere FrameBlendBgmapSprite MBgmapSprite PrintingSprite TextObjectSprite

# Public Types

enum  VisualComponentCommands
typedef const AnimationFunction AnimationFunctionROMSpec

# Public Member Functions

void constructor (Entity owner, const VisualComponentSpec *visualComponentSpec)
override void handleCommand (int32 command, va_list args)
void show ()
 Make the visual component visible.
void hide ()
 Make the visual component invisible.
uint8 getTransparent ()
void setTransparency (uint8 transparency)
bool play (const char *animationName, ListenerObject scope)
bool replay ()
void pause (bool pause)
void stop ()
 Stop any playing animation if any.
bool isPlaying ()
bool isPlayingAnimation (char *animationName)
void nextFrame ()
 Skip the currently playing animation to the next frame.
void previousFrame ()
 Rewind the currently playing animation to the previous frame.
void setActualFrame (int16 actualFrame)
int16 getActualFrame ()
void setFrameDuration (uint8 frameDuration)
uint8 getFrameDuration ()
 Retrieve the duration in game cycles for each frame of animation.
void setFrameDurationDecrement (uint8 frameDurationDecrement)
const char * getPlayingAnimationName ()
AnimationController getAnimationController ()
virtual void createAnimationController ()
 Create an animation controller for this sprite.
virtual void forceChangeOfFrame (int16 actualFrame)

# Protected Attributes

AnimationController animationController
 Animation controller.
uint8 transparency
 Transparecy effect (__TRANSPARENCY_NONE, __TRANSPARENCY_EVEN or __TRANSPARENCY_ODD)
uint8 show
 Show state flag (__HIDE, __SHOW)
bool rendered
 Rendering status flag.
bool updateAnimationFrame
 Flag to allow/prohibit the update of the animation.

# Additional Inherited Members

- Private Types inherited from Component
enum  ComponentCommands
enum  ComponentTypes
- Private Member Functions inherited from Component
void constructor (Entity owner, const ComponentSpec *componentSpec)
void destructor ()
 Class' destructor.
ComponentSpecgetSpec ()
Entity getOwner ()
 Retrieve the collider's owner.
uint32 getType ()
virtual void releaseResources ()
 Called to release the component.
virtual RightBox getRightBox ()
- Private Attributes inherited from Component
Entity owner
 Object to which this component attaches to.
const ComponentSpeccomponentSpec
 Pointer to the spec that defines how to initialize the component.
const Transformationtransformation
bool deleteMe
 Flag to mark the component as pending deletion.

# Detailed Description

Class VirtualNode

Inherits from Object

Implements an element of linked lists.

Definition at line 91 of file VisualComponent.h.

# Member Typedef Documentation

# AnimationFunctionROMSpec

An AnimationFunction that is stored in ROM

Definition at line 68 of file VisualComponent.h.

# Member Enumeration Documentation

# VisualComponentCommands

VisualComponent commands

Definition at line 31 of file VisualComponent.h.

# Member Function Documentation

# constructor()

void VisualComponent::constructor ( Entity owner,
const VisualComponentSpec * visualComponentSpec )

Class' constructor

Parameters
ownerEntity that this component attaches to
visualComponentSpecPointer to the spec that defines how to initialize the visual component

Definition at line 40 of file VisualComponent.c.

# createAnimationController()

void VisualComponent::createAnimationController ( )
virtual

Create an animation controller for this sprite.

Reimplemented in Sprite.

Definition at line 132 of file VisualComponent.c.

# forceChangeOfFrame()

void VisualComponent::forceChangeOfFrame ( int16 actualFrame)
virtual

Force the change of frame according to each child class' implementation.

Parameters
actualFrameThe frame of the playing animation to skip to

Reimplemented in Sprite.

Definition at line 137 of file VisualComponent.c.

# getActualFrame()

int16 VisualComponent::getActualFrame ( )

Retrieve the actual frame of the playing animation if any.

Returns
Actual frame of the playing animation if any

Definition at line 272 of file VisualComponent.c.

# getAnimationController()

AnimationController VisualComponent::getAnimationController ( )

Retrieve the sprite's animation controller.

Returns
sprite's animation controller

Definition at line 125 of file VisualComponent.c.

# getFrameDuration()

uint8 VisualComponent::getFrameDuration ( )

Retrieve the duration in game cycles for each frame of animation.

Definition at line 294 of file VisualComponent.c.

# getPlayingAnimationName()

const char * VisualComponent::getPlayingAnimationName ( )

Retrieve the animation function's name currently playing if any

Returns
Animation function's name currently playing if any

Definition at line 316 of file VisualComponent.c.

# getTransparent()

uint8 VisualComponent::getTransparent ( )

Retrieve the transparency mode

Returns
Transparecy effect

Definition at line 344 of file VisualComponent.c.

# handleCommand()

void VisualComponent::handleCommand ( int32 command,
va_list args )
virtual

Handle a command.

Parameters
commandCommand to handle
argsVariable arguments list depending on the command to handle

Reimplemented from Component.

Definition at line 67 of file VisualComponent.c.

# hide()

void VisualComponent::hide ( )

Make the visual component invisible.

Definition at line 336 of file VisualComponent.c.

# isPlaying()

bool VisualComponent::isPlaying ( )

Check if an animation is playing.

Returns
True if an animation is playing; false otherwise

Definition at line 210 of file VisualComponent.c.

# isPlayingAnimation()

bool VisualComponent::isPlayingAnimation ( char * animationName)

Check if the animation whose name is provided is playing.

Parameters
animationNameName of the animation to check
Returns
True if an animation is playing; false otherwise

Definition at line 223 of file VisualComponent.c.

# nextFrame()

void VisualComponent::nextFrame ( )

Skip the currently playing animation to the next frame.

Definition at line 235 of file VisualComponent.c.

# pause()

void VisualComponent::pause ( bool pause)

Pause or unpause the currently playing animation if any.

Parameters
pauseFlag that signals if the animation must be paused or unpaused

Definition at line 189 of file VisualComponent.c.

# play()

bool VisualComponent::play ( const char * animationName,
ListenerObject scope )

Play the animation with the provided name from the provided array of animation functions.

Parameters
animationNameName of the animation to play
scopeObject that will be notified of playback events
Returns
True if the animation started playing; false otherwise

Definition at line 142 of file VisualComponent.c.

# previousFrame()

void VisualComponent::previousFrame ( )

Rewind the currently playing animation to the previous frame.

Definition at line 246 of file VisualComponent.c.

# replay()

bool VisualComponent::replay ( )

Replay the last playing animation, if any, from the provided array of animation functions.

Returns
True if the animation started playing again; false otherwise

Definition at line 174 of file VisualComponent.c.

# setActualFrame()

void VisualComponent::setActualFrame ( int16 actualFrame)

Skip the currently playing animation to the provided frame.

Parameters
actualFrameThe frame of the playing animation to skip to
Returns
True if the actual frame was changed; false otherwise

Definition at line 257 of file VisualComponent.c.

# setFrameDuration()

void VisualComponent::setFrameDuration ( uint8 frameDuration)

Set the duration in game cycles for each frame of animation.

Parameters
frameDurationDuration in game cycles for each frame of animation

Definition at line 284 of file VisualComponent.c.

# setFrameDurationDecrement()

void VisualComponent::setFrameDurationDecrement ( uint8 frameDurationDecrement)

Set the decrement to frameDuration in each game cycle for each frame of animation.

Parameters
frameDurationDecrementDecrement to frameDuration in each game cycle for each frame of animation

Definition at line 306 of file VisualComponent.c.

# setTransparency()

void VisualComponent::setTransparency ( uint8 transparency)

Set the transparency mode

Parameters
transparencyTransparecy effect (__TRANSPARENCY_NONE, __TRANSPARENCY_EVEN or __TRANSPARENCY_ODD)

Definition at line 351 of file VisualComponent.c.

# show()

void VisualComponent::show ( )

Make the visual component visible.

# stop()

void VisualComponent::stop ( )

Stop any playing animation if any.

Definition at line 200 of file VisualComponent.c.

# Member Data Documentation

# animationController

AnimationController VisualComponent::animationController
protected

Animation controller.

Definition at line 96 of file VisualComponent.h.

# rendered

bool VisualComponent::rendered
protected

Rendering status flag.

Definition at line 105 of file VisualComponent.h.

# show

void VisualComponent::show
protected

Show state flag (__HIDE, __SHOW)

Definition at line 102 of file VisualComponent.h.

# transparency

uint8 VisualComponent::transparency
protected

Transparecy effect (__TRANSPARENCY_NONE, __TRANSPARENCY_EVEN or __TRANSPARENCY_ODD)

Definition at line 99 of file VisualComponent.h.

# updateAnimationFrame

bool VisualComponent::updateAnimationFrame
protected

Flag to allow/prohibit the update of the animation.

Definition at line 108 of file VisualComponent.h.


The documentation for this class was generated from the following files: