|
| Graphics (Object *parent=nullptr, std::string name="Graphics") |
| Constructor. More...
|
|
| Graphics (int w, int h, Object *parent=nullptr, std::string name="Graphics") |
| Constructor Derived classes should call this in their constructors' initialization list. More...
|
|
| ~Graphics () |
| Destructor.
|
|
void | operator() () |
| Updates this object and all of its children Derived classes should call or reimplement this at some point in their operator() This won't run if the Object isn't Active.
|
|
void | OnEarlyUpdate () |
| Starts the frame.
|
|
void | OnLateUpdate () |
| Ends the frame.
|
|
void | SetBGColor (int r, int g, int b) |
| Sets the window's background color. More...
|
|
SDL_Surface * | GetSurface () |
| Gets the surface of window. More...
|
|
SDL_Window * | GetWindow () |
| Gets the window. More...
|
|
SDL_Renderer * | GetRenderer () |
| Gets the hardware accelerated renderer. More...
|
|
void | DrawRectangle (Rectangle *rect) |
| Draws a given Rectangle. More...
|
|
void | DrawRectangle (SDL_Rect *rect, Color c, bool fill=true) |
| Draws a given Rectangle. More...
|
|
void | DrawPoint (Point *point) |
| Draws a given point. More...
|
|
void | DrawPoint (SDL_Point *point, Color c) |
| Draws a given point. More...
|
|
void | DrawLine (Line *line) |
| Draws a given line. More...
|
|
void | DrawLine (SDL_Point *start, SDL_Point *end, Color c) |
| Draws a specified line. More...
|
|
void | DrawSprite (Sprite *sprite) |
| Draws a given Sprite. More...
|
|
void | DrawSprite (Sprite *sprite, SDL_Rect clip) |
| Draws a given Sprite. More...
|
|
void | DrawText (UI::Text *text) |
| Draws text. More...
|
|
void | DrawText (UI::Text *text, SDL_Rect clip) |
| Draws text. More...
|
|
void | SetCamera (Camera *camera) |
| Sets the current camera. More...
|
|
Camera * | GetCamera () |
| Gets the current camera. More...
|
|
void | End () |
| Frees the Window and shuts down SDL if this is the last Graphics object.
|
|
void | PopulateDebugger () |
| Fills out the Debugger if it exists with this Object's information Derived classes should call their base class's version of this method.
|
|
| Object (Object *parent=nullptr, std::string name="Object") |
| Constructor Derived classes should call this in their constructors' initialization list. More...
|
|
virtual | ~Object () |
| Destructor This will End and then delete all child Objects.
|
|
const Object * | Parent () const |
| Gets the parent of this Object. More...
|
|
Object * | Parent () |
| Gets the parent of this Object. More...
|
|
const Object * | Root () const |
| Gets the root Object of the parent/child tree this Object is a part of. More...
|
|
Object * | Root () |
| Gets the root Object of the parent/child tree this Object is a part of. More...
|
|
Transform::Transform * | GetTransform () |
| Gets the first child Transform::Transform. More...
|
|
const Transform::Transform * | GetTransform () const |
| Gets the first child Transform::Transform. More...
|
|
Physics::Collider * | GetCollider () |
| Gets the first child Physics::Collider. More...
|
|
const Physics::Collider * | GetCollider () const |
| Gets the first child Physics::Collider. More...
|
|
Physics::Rigidbody * | GetRigidbody () |
| Gets the first child Physics::Rigidbody. More...
|
|
const Physics::Rigidbody * | GetRigidbody () const |
| Gets the first child Physics::Rigidbody. More...
|
|
void | AddChild (Object *child) |
| Adds child to this Object's list of children This will also set child's _parent to this This will do nothing if child is already in the list of children Useful for adding an already created Object as a child or passing in the return operator new with parameters. More...
|
|
template<typename T > |
T * | CreateChild () |
| Creates a new child of type T Useful for creating an object with no constructor parameters and/or modifying it later. More...
|
|
template<typename T > |
T * | CreateChild (std::string name) |
| Creates a new child of type T Useful for creating an object with no constructor parameters and/or modifying it later. More...
|
|
void | RemoveChild (Object *child) |
| Removes child from this Object's list of children This will also set child's _parent to nullptr This will do nothing if child is not in the Object's list of children. More...
|
|
void | RemoveChild (unsigned index) |
| Removes the child at index from this Object's list of children This will also set the child's _parent to nullptr This will do nothing if index is out of range of the Object's list of children. More...
|
|
Object * | operator[] (unsigned index) |
| Gets the child at index from this Object's list of children. More...
|
|
int | operator[] (Object *child) |
| Gets the index of a given child in this Object's list of children. More...
|
|
Object * | GetLastChild () |
| Gets the youngest child from this Object's list of children. More...
|
|
int | ParentCount () |
| Determines the generation of this object in the parent/child tree. More...
|
|
template<typename T > |
T * | FindAncestorOfType () const |
| Finds the closest ancestor Object of a type applicable to that which was requested. More...
|
|
template<typename T > |
const T * | FindChildOfType () const |
| Finds the first child Object of a type applicable to that which was requested. More...
|
|
template<typename T > |
T * | FindChildOfType () |
| Finds the first child Object of a type applicable to that which was requested. More...
|
|
template<typename T > |
const std::vector< T * > | FindChildrenOfType () const |
| Finds all children Objects of a type applicable to that which was requested. More...
|
|
template<typename T > |
std::vector< T * > | FindChildrenOfType () |
| Finds all children Objects of a type applicable to that which was requested. More...
|
|
template<typename T > |
const std::vector< T * > | FindDescendentsOfType () const |
| Recursively finds all descendent Objects of a type applicable to that which was requested. More...
|
|
template<typename T > |
std::vector< T * > | FindDescendentsOfType () |
| Recursively finds all descendent Objects of a type applicable to that which was requested. More...
|
|
const bool & | Valid () const |
| Determines if the Object is valid. More...
|
|
bool | Active () const |
| Determines if the Object is active. More...
|
|
void | SetActive (bool active) |
| Sets active status of the object Triggers OnActivate or OnDeactivate appropriately. More...
|
|
void | Activate () |
| Activates the object Triggers OnActivate appropriately.
|
|
void | Deactivate () |
| Deactivates the object Triggers OnDeactivate appropriately.
|
|
| operator bool () const |
| Converts Object to bool by calling Valid Example: ``` Object o; while (o) o(); ```.
|
|
void | PrintTree (Log::Log &log) const |
| Uses Log::Log to print the parent/children tree of this Object. More...
|
|
void | PrintTree () const |
| Uses Log::Log to print the parent/children tree of this Object Uses Log::Debug.
|
|
std::string | Name () const |
| Gets the Object's name. More...
|
|
unsigned | ChildrenCount () const |
| Determines the number of immediate children the Object has. More...
|
|
std::vector< Object * > & | Children () |
| Gets the list of Objects that are children of this Object. More...
|
|
bool | HasAncestor (const Object *other) const |
| Determines if the provided Object is an ancestor of this Object. More...
|
|
virtual void | OnStart () |
| Run when the Object is created.
|
|
virtual void | OnActivate () |
| Run when the Object is activated Run after OnStart.
|
|
virtual void | OnUpdate () |
| Run every frame.
|
|
virtual void | OnDeactivate () |
| Run when the Object is deactivated Run before OnEnd.
|
|
virtual void | OnEnd () |
| Run when the Object is ended/destroyed.
|
|
virtual void | OnCollision (Physics::Collision c) |
| Run when a collision occurs. More...
|
|
virtual void | OnMouseEnter () |
| Run when the mouse enters the Object.
|
|
virtual void | OnMouseOver () |
| Run while the mouse is over the Object.
|
|
virtual void | OnMouseExit () |
| Run when the mouse leaves the Object.
|
|
virtual void | OnMouseClick () |
| Run when the mouse is clicked while over the Object.
|
|
virtual void | OnMouseRelease () |
| Run when the mouse is released while over the Object.
|
|