Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
RectangleRenderComponent Class Reference

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>

Inheritance diagram for RectangleRenderComponent:
RenderComponent Component

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.
 
- Public Member Functions inherited from RenderComponent
 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
 
- Public Member Functions inherited from Component
 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.
 
ActorGetOwner () 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).
 
- Public Attributes inherited from RenderComponent
Color mColor { 255,255,255,255 }
 

Additional Inherited Members

- Protected Attributes inherited from Component
ActormOwner = nullptr
 The actor that owns this component.
 

Detailed Description

RectangleRenderComponent is a simple render component for drawing a 2D rectangle. It renders in viewport space, making it suitable for UI or overlays.

Member Function Documentation

◆ GetRenderType()

RenderType RectangleRenderComponent::GetRenderType ( )
overridevirtual

Returns the rendering category (Viewport) for this rectangle component.

Returns
RenderType::Viewport

Implements RenderComponent.

◆ Render()

void RectangleRenderComponent::Render ( IRenderer * pRenderer)
overridevirtual

Renders the rectangle in screen space using the assigned color. Takes into account the owner's transform position.

Parameters
pRendererRenderer interface for drawing the shape.

Implements RenderComponent.

Member Data Documentation

◆ mRectangle

Rectangle RectangleRenderComponent::mRectangle {Vector2(-16,-16),Vector2(32,32)}

The local rectangle definition (position is relative to actor's transform).


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