Wraith  0.1.5
Basic 3D game engine in C++
Sprite Class Reference

A sprite used to display 2D images. More...

#include <Sprite.h>

Collaboration diagram for Sprite:
Collaboration graph

Public Member Functions

 Sprite (const Sprite &)=default
 
Spriteoperator= (const Sprite &)=default
 
 Sprite (Sprite &&)=default
 
Spriteoperator= (Sprite &&)=default
 
 Sprite (const std::string &imageKey)
 Constructs sprite using image key defined within Image Manager. More...
 
void render ()
 Renders this sprite. More...
 
void setPosition (float positionX, float positionY)
 Sets sprite position. More...
 
float getPositionX () const
 Gets position x coordinate. More...
 
float getPositionY () const
 Gets position y coordinate. More...
 
void setCenter (float centerX, float centerY)
 Sets sprite center. More...
 
void setAngle (float angle)
 Sets sprite angle./ More...
 
float getAngle () const
 Gets the sprite angle. More...
 
void offsetAngle (float angleOffset)
 Offset sprite angle. More...
 
void setScaleFactor (float scaleX, float scaleY)
 Sets scale factor. More...
 
void setScalePixel (float width, float height)
 Sets scale pixel. More...
 
float getWidth () const
 Gets the width of the sprite. More...
 
float getHeight () const
 Gets the height of the sprite. More...
 

Private Member Functions

void setToUpdateWorld ()
 
void setToNullModifier ()
 
void updateWorld ()
 
Matrix getCenterMatrix () const
 
Matrix getPositionMatrix () const
 
Matrix getRotationMatrix () const
 
Matrix getScaleMatrix () const
 
Matrix getScalePixelMatrix () const
 

Private Attributes

float _positionX
 
float _positionY
 
float _centerX
 
float _centerY
 
float _angle
 
float _scaleX
 
float _scaleY
 
float _width
 
float _height
 
GraphicsObject_Sprite * _pSpriteGraphicsObject
 
SpriteModifierStrategy_pPropertyModifierStrategy
 

Friends

class SpriteAttorney
 

Detailed Description

A sprite used to display 2D images.

In the constructor, it uses a key assigned in the ImageManager.

Member Function Documentation

◆ getPositionY()

float Sprite::getPositionY ( ) const

Gets position y coordinate.

.

Returns
The position y coordinate.

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