jGL
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
jGL::Sprite Class Reference

#include <sprite.h>

Collaboration diagram for jGL::Sprite:
Collaboration graph
[legend]

Public Member Functions

 Sprite ()=default
 
 Sprite (Transform *tra, TextureRegion *to, Texture *tex, glm::vec4 *colour)
 Construct a Sprite.
 
WorldBoundingBox getWorldBoundingBox () const
 Get the WorldBoundingBox of the Sprite.
 
ScreenBoundingBox getScreenBoundingBox (const OrthoCam &camera)
 Get the ScreenBoundingBox of the Sprite.
 
NormalisedTextureRegion getNormalisedTextureRegion () const
 

Public Attributes

Transformtransform
 
TextureRegiontexOffset
 
Texturetexture
 
glm::vec4 * colour
 

Protected Member Functions

NormalisedTextureRegion toNormalised (TextureRegion to) const
 
TextureRegion fromNormalised (NormalisedTextureRegion to) const
 

Constructor & Destructor Documentation

◆ Sprite() [1/2]

jGL::Sprite::Sprite ( )
default

◆ Sprite() [2/2]

jGL::Sprite::Sprite ( Transform tra,
TextureRegion to,
Texture tex,
glm::vec4 *  colour 
)
inline

Construct a Sprite.

Parameters
trax, y, theta, scale Transform
toRegion of texture to draw
texTexture to draw
alphaTransparency modifier (alpha * texture alpha)

Member Function Documentation

◆ fromNormalised()

TextureRegion jGL::Sprite::fromNormalised ( NormalisedTextureRegion  to) const
inlineprotected

◆ getNormalisedTextureRegion()

NormalisedTextureRegion jGL::Sprite::getNormalisedTextureRegion ( ) const
inline

◆ getScreenBoundingBox()

ScreenBoundingBox jGL::Sprite::getScreenBoundingBox ( const OrthoCam camera)
inline

Get the ScreenBoundingBox of the Sprite.

Parameters
camerafor projection to the screen.
Returns
ScreenBoundingBox

◆ getWorldBoundingBox()

WorldBoundingBox jGL::Sprite::getWorldBoundingBox ( ) const
inline

Get the WorldBoundingBox of the Sprite.

Returns
WorldBoundingBox

◆ toNormalised()

NormalisedTextureRegion jGL::Sprite::toNormalised ( TextureRegion  to) const
inlineprotected

Member Data Documentation

◆ colour

glm::vec4* jGL::Sprite::colour

◆ texOffset

TextureRegion* jGL::Sprite::texOffset

◆ texture

Texture* jGL::Sprite::texture

◆ transform

Transform* jGL::Sprite::transform

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