Sly Engine
SlySprite Class Reference

#include <SlySprite.h>

Collaboration diagram for SlySprite:
Collaboration graph

Public Types

typedef std::string ImageKey
 Defines an alias representing the image key. More...
 

Public Member Functions

 SlySprite ()=delete
 Default constructor. More...
 
 SlySprite (const SlySprite &)=delete
 Copy constructor. More...
 
 SlySprite (SlySprite &&)=delete
 Move constructor. More...
 
SlySpriteoperator= (const SlySprite &)=delete
 Assignment operator. More...
 
SlySpriteoperator= (SlySprite &&)=delete
 Move assignment operator. More...
 
virtual ~SlySprite ()
 Deconstructor. More...
 
 SlySprite (ImageKey imgKey)
 Specialized Constructor. More...
 
 SlySprite (Image *inputImage)
 
float GetAngle ()
 Gets the angle. More...
 
float GetWidth ()
 Gets the sprite's width. More...
 
float GetHeight ()
 Gets the sprite height. More...
 
void Render ()
 Renders the sprite with the current 2D Camera. More...
 
void Render (Camera *renderCam)
 Renders the sprite to the given renderCam. More...
 
void SetAngle (float a)
 Sets the sprite angle. More...
 
void SetCenter (float offsetX, float offsetY)
 Sets the center of the sprite. More...
 
void SetPosition (float x, float y)
 Sets the sprite position. More...
 
void SetScaleFactor (float scalex, float scaley)
 Sets scale factor. More...
 
void SetScalePixel (float width, float height)
 Sets scale pixel. More...
 
void SetWorld ()
 

Private Attributes

GraphicsObject_Sprite * pGOSprite
 
Rect * inputRectangle
 
float angle
 
float centerX
 
float centerY
 
float scaleX
 
float scaleY
 
float width
 
float height
 

Member Typedef Documentation

◆ ImageKey

std::string SlySprite::ImageKey

Defines an alias representing the image key.

Constructor & Destructor Documentation

◆ SlySprite() [1/5]

SlySprite::SlySprite ( )
delete

Default constructor.

◆ SlySprite() [2/5]

SlySprite::SlySprite ( const SlySprite )
delete

Copy constructor.

◆ SlySprite() [3/5]

SlySprite::SlySprite ( SlySprite &&  )
delete

Move constructor.

◆ ~SlySprite()

SlySprite::~SlySprite ( )
virtual

Deconstructor.

◆ SlySprite() [4/5]

SlySprite::SlySprite ( ImageKey  imgKey)

Specialized Constructor.

Parameters
imgKeyThe image key.

The creation of a SlySprite requires an image. This is the normal way to setup a Sly Sprite. Image must be loaded in prior to calling creating a sprite.

Here is the call graph for this function:

◆ SlySprite() [5/5]

SlySprite::SlySprite ( Image *  inputImage)
Here is the call graph for this function:

Member Function Documentation

◆ GetAngle()

float SlySprite::GetAngle ( )

Gets the angle.

Returns
The sprite's angle.

◆ GetHeight()

float SlySprite::GetHeight ( )

Gets the sprite height.

Returns
The height.
Here is the caller graph for this function:

◆ GetWidth()

float SlySprite::GetWidth ( )

Gets the sprite's width.

Returns
The width.
Here is the caller graph for this function:

◆ operator=() [1/2]

SlySprite& SlySprite::operator= ( const SlySprite )
delete

Assignment operator.

◆ operator=() [2/2]

SlySprite& SlySprite::operator= ( SlySprite &&  )
delete

Move assignment operator.

◆ Render() [1/2]

void SlySprite::Render ( )

Renders the sprite with the current 2D Camera.

The CameraManager loads in a default 2D Camera to be used for sprite rendering. This camera may be changed at the scene level if a different camera is desired.

See also
Scene::SetCurrent2DCamera
Here is the call graph for this function:

◆ Render() [2/2]

void SlySprite::Render ( Camera *  renderCam)

Renders the sprite to the given renderCam.

Parameters
[in,out]renderCamIf non-null, the render camera.

This render operation should be avoided unless the user specifically wishes to render to a different camera other than the current 2D one associated with the scene.

◆ SetAngle()

void SlySprite::SetAngle ( float  a)

Sets the sprite angle.

Parameters
aThe angle.
Here is the call graph for this function:

◆ SetCenter()

void SlySprite::SetCenter ( float  offsetX,
float  offsetY 
)

Sets the center of the sprite.

Parameters
offsetXThe offset x coordinate.
offsetYThe offset y coordinate.
Here is the caller graph for this function:

◆ SetPosition()

void SlySprite::SetPosition ( float  x,
float  y 
)

Sets the sprite position.

Parameters
xThe x coordinate.
yThe y coordinate.
Here is the call graph for this function:

◆ SetScaleFactor()

void SlySprite::SetScaleFactor ( float  scalex,
float  scaley 
)

Sets scale factor.

Parameters
scalexThe x scale.
scaleyThe y scale.
Here is the call graph for this function:

◆ SetScalePixel()

void SlySprite::SetScalePixel ( float  width,
float  height 
)

Sets scale pixel.

Parameters
widthThe width.
heightThe height.
Here is the call graph for this function:

◆ SetWorld()

void SlySprite::SetWorld ( )
Here is the caller graph for this function:

Member Data Documentation

◆ angle

float SlySprite::angle
private

◆ centerX

float SlySprite::centerX
private

◆ centerY

float SlySprite::centerY
private

◆ height

float SlySprite::height
private

◆ inputRectangle

Rect* SlySprite::inputRectangle
private

◆ pGOSprite

GraphicsObject_Sprite* SlySprite::pGOSprite
private

◆ scaleX

float SlySprite::scaleX
private

◆ scaleY

float SlySprite::scaleY
private

◆ width

float SlySprite::width
private

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