CitroFlex3ds 0.1
CitroFlex3DS is a lightweight game engine designed specifically for Nintendo 3DS homebrew development. It provides a simple framework for creating games and applications.
 
Loading...
Searching...
No Matches
Objects::Sprite Class Reference

Sprite object for displaying images. More...

#include <Objects.hpp>

Inheritance diagram for Objects::Sprite:
Objects::Object

Public Member Functions

 ~Sprite ()
 Destructor.
 
virtual void Update (Scene::Scene *scene) override
 Update and draw the sprite.
 
double getAngle ()
 Get the current rotation angle.
 
void SetAngle (double new_angle)
 Set the rotation angle.
 
void AddAngle (double add_angle)
 Add to the current rotation angle.
 
bool LoadFromFile (const char *path)
 Load a sprite from a file.
 
void SetFrame (int index)
 Set the current frame of the sprite.
 
- Public Member Functions inherited from Objects::Object
double get_x ()
 Get the X position.
 
void SetX (double new_x)
 Set the X position.
 
void AddX (double add_x)
 Add to the X position.
 
double get_y ()
 Get the Y position.
 
void SetY (double new_y)
 Set the Y position.
 
void AddY (double add_y)
 Add to the Y position.
 
virtual void Init ()
 Initialize the object.
 
void UpdateAttached ()
 Updates the objects attached to this instance.
 
void Attach (Object *obj)
 Attach an object to this object and set its relative position.
 
void SetScene (Scene::Scene *scene)
 Setter for the currentscene (called by the Scene instance)
 
Scene::Scene * GetScene () const
 Getter for the currentscene (called by the Scene instance)
 
void SetInputManager (Input::InputManager *manager)
 Setter for the inputmanager (called by the Scene instance)
 

Public Attributes

float width = 0
 Width of the sprite.
 
float height = 0
 Height of the sprite.
 
- Public Attributes inherited from Objects::Object
bool visible = true
 
std::vector< Objects::Object * > attachedElements
 
Object * parent = nullptr
 
int id = -1
 

Additional Inherited Members

- Protected Member Functions inherited from Objects::Object
virtual void OnUpdate (Scene::Scene *scene)
 Custom update logic (can be override to add custom logic before Drawing)
 
Input::InputManager * GetInputManager () const
 Getter for the InputManager.
 

Detailed Description

Sprite object for displaying images.

Member Function Documentation

◆ AddAngle()

void Sprite::AddAngle ( double add_angle)

Add to the current rotation angle.

Parameters
add_angleAngle to add in degrees

◆ getAngle()

double Sprite::getAngle ( )

Get the current rotation angle.

Returns
Current angle in degrees

◆ LoadFromFile()

bool Sprite::LoadFromFile ( const char * path)

Load a sprite from a file.

Parameters
pathPath to the image file
Returns
true if loading succeeded, false otherwise

◆ SetAngle()

void Sprite::SetAngle ( double new_angle)

Set the rotation angle.

Parameters
new_angleNew angle in degrees

◆ SetFrame()

void Sprite::SetFrame ( int index)

Set the current frame of the sprite.

Parameters
indexIndex of the frame to display

◆ Update()

void Sprite::Update ( Scene::Scene * scene)
overridevirtual

Update and draw the sprite.

Parameters
scenePointer to the current scene

Reimplemented from Objects::Object.


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