Rise
The Vieneo Province
Loading...
Searching...
No Matches
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 (RiseMath::Color prmColor)
void Draw () const
void SetLocation (int absoluteX, int absoluteY)
void SetRectangle (int top, int left, int right, int bottom)
void SetRotationCenter (RiseMath::Vector2 rotationCenter)
void Evict ()

Public Attributes

float rotate = 0.0f
float mag = 1.0f

Private Attributes

Rendering::RenderSprite * pSprite = nullptr
Rendering::RenderTexture * pTexture = nullptr
Logger * logger = nullptr
int x = 0
int y = 0
int width = 0
int height = 0
float z = 0.0f
RiseMath::Color color = {}
RiseMath::Matrix matWorld = {}
RiseMath::Vector3 position = RiseMath::Vector3(0, 0, 0)
RiseMath::Vector2 centerRotation = RiseMath::Vector2(0, 0)
RiseMath::Vector2 scale
RECT rect = {}
int top = 0
int left = 0
RiseMath::Vector2 centerOffset = RiseMath::Vector2(0, 0)
DeviceObject * deviceObject
std::string pathAndFilename

Detailed Description

See also
http://mscerts.programming4.us/programming/directx%2010%20game%20programming%20%20%20the%202d%20resurgence%20-%20sprites.aspx /// Everything in here is a pointer managed by some other class ... so there is no destructor

Definition at line 10 of file Sprite.h.

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 ( ) const

Definition at line 81 of file Sprite.cpp.

Here is the call graph for this function:

◆ Draw() [2/2]

void Sprite::Draw ( RiseMath::Color prmColor)

Definition at line 75 of file Sprite.cpp.

Here is the call graph for this function:

◆ Evict()

void Sprite::Evict ( )

Definition at line 45 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 99 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 105 of file Sprite.cpp.

Here is the caller graph for this function:

◆ SetRotationCenter()

void Sprite::SetRotationCenter ( RiseMath::Vector2 rotationCenter)
inline

Definition at line 52 of file Sprite.h.

Here is the caller graph for this function:

◆ Update()

void Sprite::Update ( )

Definition at line 50 of file Sprite.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ centerOffset

RiseMath::Vector2 Sprite::centerOffset = RiseMath::Vector2(0, 0)
private

Definition at line 28 of file Sprite.h.

◆ centerRotation

RiseMath::Vector2 Sprite::centerRotation = RiseMath::Vector2(0, 0)
private

Definition at line 23 of file Sprite.h.

◆ color

RiseMath::Color Sprite::color = {}
private

Definition at line 20 of file Sprite.h.

◆ deviceObject

DeviceObject* Sprite::deviceObject
private

Definition at line 29 of file Sprite.h.

◆ height

int Sprite::height = 0
private

Definition at line 17 of file Sprite.h.

◆ left

int Sprite::left = 0
private

Definition at line 27 of file Sprite.h.

◆ logger

Logger* Sprite::logger = nullptr
private

Definition at line 16 of file Sprite.h.

◆ mag

float Sprite::mag = 1.0f

Definition at line 36 of file Sprite.h.

◆ matWorld

RiseMath::Matrix Sprite::matWorld = {}
private

Definition at line 21 of file Sprite.h.

◆ pathAndFilename

std::string Sprite::pathAndFilename
private

Definition at line 30 of file Sprite.h.

◆ position

RiseMath::Vector3 Sprite::position = RiseMath::Vector3(0, 0, 0)
private

Definition at line 22 of file Sprite.h.

◆ pSprite

Rendering::RenderSprite* Sprite::pSprite = nullptr
private

Definition at line 13 of file Sprite.h.

◆ pTexture

Rendering::RenderTexture* Sprite::pTexture = nullptr
private

Definition at line 15 of file Sprite.h.

◆ rect

RECT Sprite::rect = {}
private

Definition at line 25 of file Sprite.h.

◆ rotate

float Sprite::rotate = 0.0f

Definition at line 35 of file Sprite.h.

◆ scale

RiseMath::Vector2 Sprite::scale
private

Definition at line 24 of file Sprite.h.

◆ top

int Sprite::top = 0
private

Definition at line 26 of file Sprite.h.

◆ width

int Sprite::width = 0
private

Definition at line 17 of file Sprite.h.

◆ x

int Sprite::x = 0
private

Definition at line 17 of file Sprite.h.

◆ y

int Sprite::y = 0
private

Definition at line 17 of file Sprite.h.

◆ z

float Sprite::z = 0.0f
private

Definition at line 18 of file Sprite.h.


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