ScummVM API documentation
Gob::ANIObject Class Reference

#include <aniobject.h>

Inheritance diagram for Gob::ANIObject:
Gob::BackBuffer Gob::Geisha::EvilFish Gob::Geisha::Mouth Gob::Geisha::Oko Gob::Geisha::Submarine Gob::OnceUpon::CharGenChild Gob::OnceUpon::Stork

Public Types

enum  Mode { kModeContinuous, kModeOnce }
 

Public Member Functions

 ANIObject (const ANIFile &ani)
 
 ANIObject (const CMPFile &cmp)
 
void setVisible (bool visible)
 
bool isVisible () const
 
void setPause (bool pause)
 
bool isPaused () const
 
void setMode (Mode mode)
 
virtual void setPosition ()
 
virtual void setPosition (int16 x, int16 y)
 
void getPosition (int16 &x, int16 &y) const
 
void getFramePosition (int16 &x, int16 &y, uint16 n=0) const
 
void getFrameSize (int16 &width, int16 &height, uint16 n=0) const
 
bool isIn (int16 x, int16 y) const
 
bool isIn (const ANIObject &obj) const
 
void setAnimation (uint16 animation)
 
void rewind ()
 
void setFrame (uint16 frame)
 
uint16 getAnimation () const
 
uint16 getFrame () const
 
bool lastFrame () const
 
virtual bool draw (Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom)
 
virtual bool clear (Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom)
 
virtual void advance ()
 

Additional Inherited Members

- Protected Member Functions inherited from Gob::BackBuffer
void trashBuffer ()
 
void resizeBuffer (uint16 width, uint16 height)
 
bool saveScreen (const Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom)
 
bool restoreScreen (Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom)
 
bool hasBuffer () const
 
bool hasSavedBackground () const
 

Detailed Description

An ANI object, controlling an animation within an ANI file.

Member Enumeration Documentation

◆ Mode

Enumerator
kModeContinuous 

Play the animation continuously.

kModeOnce 

Play the animation only once.

Constructor & Destructor Documentation

◆ ANIObject() [1/2]

Gob::ANIObject::ANIObject ( const ANIFile ani)

Create an animation object from an ANI file.

◆ ANIObject() [2/2]

Gob::ANIObject::ANIObject ( const CMPFile cmp)

Create an animation object from a CMP sprite.

Member Function Documentation

◆ setVisible()

void Gob::ANIObject::setVisible ( bool  visible)

Make the object visible/invisible.

◆ isVisible()

bool Gob::ANIObject::isVisible ( ) const

Is the object currently visible?

◆ setPause()

void Gob::ANIObject::setPause ( bool  pause)

Pause/Unpause the animation.

◆ isPaused()

bool Gob::ANIObject::isPaused ( ) const

Is the animation currently paused?

◆ setMode()

void Gob::ANIObject::setMode ( Mode  mode)

Set the animation mode.

◆ setPosition() [1/2]

virtual void Gob::ANIObject::setPosition ( )
virtual

Set the current position to the animation's default.

◆ setPosition() [2/2]

virtual void Gob::ANIObject::setPosition ( int16  x,
int16  y 
)
virtual

Set the current position.

Reimplemented in Gob::Geisha::Mouth.

◆ getPosition()

void Gob::ANIObject::getPosition ( int16 &  x,
int16 &  y 
) const

Return the current position.

◆ getFramePosition()

void Gob::ANIObject::getFramePosition ( int16 &  x,
int16 &  y,
uint16  n = 0 
) const

Return the frame position after another n frames.

◆ getFrameSize()

void Gob::ANIObject::getFrameSize ( int16 &  width,
int16 &  height,
uint16  n = 0 
) const

Return the current frame size after another n frames.

◆ isIn() [1/2]

bool Gob::ANIObject::isIn ( int16  x,
int16  y 
) const

Are there coordinates within the animation sprite?

◆ isIn() [2/2]

bool Gob::ANIObject::isIn ( const ANIObject obj) const

Is this object within the animation sprite?

◆ setAnimation()

void Gob::ANIObject::setAnimation ( uint16  animation)

Set the animation number.

◆ rewind()

void Gob::ANIObject::rewind ( )

Rewind the current animation to the first frame.

◆ setFrame()

void Gob::ANIObject::setFrame ( uint16  frame)

Set the animation to a specific frame.

◆ getAnimation()

uint16 Gob::ANIObject::getAnimation ( ) const

Return the current animation number.

◆ getFrame()

uint16 Gob::ANIObject::getFrame ( ) const

Return the current frame number.

◆ lastFrame()

bool Gob::ANIObject::lastFrame ( ) const

Is this the last frame within this animation cycle?

◆ draw()

virtual bool Gob::ANIObject::draw ( Surface dest,
int16 &  left,
int16 &  top,
int16 &  right,
int16 &  bottom 
)
virtual

Draw the current frame onto the surface and return the affected rectangle.

Reimplemented in Gob::OnceUpon::Stork, and Gob::Geisha::Mouth.

◆ clear()

virtual bool Gob::ANIObject::clear ( Surface dest,
int16 &  left,
int16 &  top,
int16 &  right,
int16 &  bottom 
)
virtual

Draw the current frame from the surface and return the affected rectangle.

Reimplemented in Gob::OnceUpon::Stork, and Gob::Geisha::Mouth.

◆ advance()

virtual void Gob::ANIObject::advance ( )
virtual

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