Claire's Game Engine
Full C++ Engine using OpenGL
|
RectangleRenderComponent is a simple render component for drawing a 2D rectangle. It renders in viewport space, making it suitable for UI or overlays. More...
#include <RectangleRenderComponent.h>
Public Member Functions | |
void | Render (IRenderer *pRenderer) override |
Renders the rectangle in screen space using the assigned color. Takes into account the owner's transform position. | |
RenderType | GetRenderType () override |
Returns the rendering category (Viewport) for this rectangle component. | |
![]() | |
RenderComponent (Actor *pOwner) | |
Constructs the RenderComponent and assigns it to the owning Actor. | |
void | OnStart () override |
Called when the component is started. Registers the component with the scene's renderer for drawing. | |
void | OnEnd () override |
Called when the component is removed or destroyed. Unregisters the component from the renderer. | |
virtual int | GetDrawOrder () const |
![]() | |
Component (Actor *pOwner, int pUpdateOrder=100) | |
Constructor for Component. | |
virtual | ~Component () |
virtual void | Update () |
Called every frame to update the component. This can be used to perform actions that need to be updated periodically. | |
virtual void | OnUpdateWorldTrandform () |
Called when the world transform of the actor is updated. This allows the component to react to changes in the actor's world transform. | |
void | SetActive (bool isActive) |
Sets the active status of the component. | |
void | SetOwner (Actor *pOwner) |
Sets the actor that owns this component. | |
int | GetUpdateOrder () const |
Returns the update order of the component. Components with lower update orders are updated first. | |
Actor * | GetOwner () const |
Returns the actor that owns this component. | |
Public Attributes | |
Rectangle | mRectangle {Vector2(-16,-16),Vector2(32,32)} |
The local rectangle definition (position is relative to actor's transform). | |
![]() | |
Color | mColor { 255,255,255,255 } |
Additional Inherited Members | |
![]() | |
Actor * | mOwner = nullptr |
The actor that owns this component. | |
RectangleRenderComponent is a simple render component for drawing a 2D rectangle. It renders in viewport space, making it suitable for UI or overlays.
|
overridevirtual |
Returns the rendering category (Viewport) for this rectangle component.
Implements RenderComponent.
|
overridevirtual |
Renders the rectangle in screen space using the assigned color. Takes into account the owner's transform position.
pRenderer | Renderer interface for drawing the shape. |
Implements RenderComponent.
The local rectangle definition (position is relative to actor's transform).