Rise
The Vieneo Province
Sprite Class Reference

#include <Sprite.h>

Collaboration diagram for Sprite:
[legend]

Public Member Functions

 Sprite (Logger *prmLogger, DeviceObject *prmpDevice, std::string prmPathAndFilename, int prmX, int prmY, float prmZ, int prmTop, int prmLeft, int prmWidth, int prmHeight, DWORD prmColor, float scaleX=1.0f, float scaleY=1.0f)
 
void Update ()
 
void Draw (D3DXCOLOR prmColor)
 
void Draw () const
 
void SetLocation (int absoluteX, int absoluteY)
 
void SetRectangle (int top, int left, int right, int bottom)
 
void SetRotationCenter (D3DXVECTOR2 rotationCenter)
 

Public Attributes

float rotate = 0.0f
 
float mag = 1.0f
 

Private Attributes

LPD3DXSPRITE pSprite = nullptr
 
LPDIRECT3DTEXTURE9 pTexture = nullptr
 
Loggerlogger = nullptr
 
int x = 0
 
int y = 0
 
int width = 0
 
int height = 0
 
float z = 0.0f
 
D3DXCOLOR color = {}
 
D3DXMATRIX matWorld = {}
 
D3DXVECTOR3 position = D3DXVECTOR3(0, 0, 0)
 
D3DXVECTOR2 centerRotation = D3DXVECTOR2(0, 0)
 
D3DXVECTOR2 scale
 
RECT rect = {}
 
int top = 0
 
int left = 0
 
D3DXVECTOR2 centerOffset = D3DXVECTOR2(0, 0)
 

Detailed Description

Constructor & Destructor Documentation

◆ Sprite()

Sprite::Sprite ( Logger prmLogger,
DeviceObject prmpDevice,
std::string  prmPathAndFilename,
int  prmX,
int  prmY,
float  prmZ,
int  prmTop,
int  prmLeft,
int  prmWidth,
int  prmHeight,
DWORD  prmColor,
float  scaleX = 1.0f,
float  scaleY = 1.0f 
)

we are offset by screen location using the projection matrix this works for sprites but not fonts apparently for some reason

Definition at line 5 of file Sprite.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Draw() [1/2]

void Sprite::Draw ( D3DXCOLOR  prmColor)

Definition at line 66 of file Sprite.cpp.

Here is the call graph for this function:

◆ Draw() [2/2]

void Sprite::Draw ( ) const

Definition at line 72 of file Sprite.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetLocation()

void Sprite::SetLocation ( int  absoluteX,
int  absoluteY 
)

Definition at line 90 of file Sprite.cpp.

Here is the caller graph for this function:

◆ SetRectangle()

void Sprite::SetRectangle ( int  top,
int  left,
int  right,
int  bottom 
)

Definition at line 96 of file Sprite.cpp.

Here is the caller graph for this function:

◆ SetRotationCenter()

void Sprite::SetRotationCenter ( D3DXVECTOR2  rotationCenter)
inline

Definition at line 47 of file Sprite.h.

Here is the caller graph for this function:

◆ Update()

void Sprite::Update ( )

Definition at line 41 of file Sprite.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ centerOffset

D3DXVECTOR2 Sprite::centerOffset = D3DXVECTOR2(0, 0)
private

Definition at line 25 of file Sprite.h.

◆ centerRotation

D3DXVECTOR2 Sprite::centerRotation = D3DXVECTOR2(0, 0)
private

Definition at line 20 of file Sprite.h.

◆ color

D3DXCOLOR Sprite::color = {}
private

Definition at line 17 of file Sprite.h.

◆ height

int Sprite::height = 0
private

Definition at line 14 of file Sprite.h.

◆ left

int Sprite::left = 0
private

Definition at line 24 of file Sprite.h.

◆ logger

Logger* Sprite::logger = nullptr
private

Definition at line 13 of file Sprite.h.

◆ mag

float Sprite::mag = 1.0f

Definition at line 31 of file Sprite.h.

◆ matWorld

D3DXMATRIX Sprite::matWorld = {}
private

Definition at line 18 of file Sprite.h.

◆ position

D3DXVECTOR3 Sprite::position = D3DXVECTOR3(0, 0, 0)
private

Definition at line 19 of file Sprite.h.

◆ pSprite

LPD3DXSPRITE Sprite::pSprite = nullptr
private

Definition at line 10 of file Sprite.h.

◆ pTexture

LPDIRECT3DTEXTURE9 Sprite::pTexture = nullptr
private

Definition at line 12 of file Sprite.h.

◆ rect

RECT Sprite::rect = {}
private

Definition at line 22 of file Sprite.h.

◆ rotate

float Sprite::rotate = 0.0f

Definition at line 30 of file Sprite.h.

◆ scale

D3DXVECTOR2 Sprite::scale
private

Definition at line 21 of file Sprite.h.

◆ top

int Sprite::top = 0
private

Definition at line 23 of file Sprite.h.

◆ width

int Sprite::width = 0
private

Definition at line 14 of file Sprite.h.

◆ x

int Sprite::x = 0
private

Definition at line 14 of file Sprite.h.

◆ y

int Sprite::y = 0
private

Definition at line 14 of file Sprite.h.

◆ z

float Sprite::z = 0.0f
private

Definition at line 15 of file Sprite.h.


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