SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::core::components::Circle Class Referencefinal

A simple component to render a circle. More...

#include <Circle.h>

Inheritance diagram for spark::core::components::Circle:
spark::core::Component spark::rtti::HasRtti

Public Member Functions

 Circle (GameObject *parent)
 Creates a new circle component . Defaults to a radius of 25.
 
 Circle (GameObject *parent, const float radius)
 Creates a new circle component .
 
void render () const override
 Renders the component.
 
- Public Member Functions inherited from spark::core::Component
 Component (GameObject *parent)
 Instantiates a new Component.
 
 Component (const Component &other)=delete
 
 Component (Component &&other) noexcept=default
 
Componentoperator= (const Component &other)=delete
 
Componentoperator= (Component &&other) noexcept=default
 
const lib::Uuiduuid () const
 Gets the UUID of the component.
 
GameObjectgameObject ()
 Gets the GameObject that the component is attached to.
 
const GameObjectgameObject () const
 Gets the GameObject that the component is attached to.
 
virtual void onAttach ()
 Method called when the component is attached to a GameObject.
 
virtual void onUpdate (float dt)
 Method called on every frame.
 
virtual void onDetach ()
 Method called when the component is detached from a GameObject.
 
- Public Member Functions inherited from spark::rtti::HasRtti
 HasRtti (const HasRtti &other)=default
 
 HasRtti (HasRtti &&other) noexcept=default
 
HasRttioperator= (const HasRtti &other)=default
 
HasRttioperator= (HasRtti &&other) noexcept=default
 
virtual RttiBaserttiInstance () const =0
 

Public Attributes

float radius = 25
 

Detailed Description

A simple component to render a circle.

Constructor & Destructor Documentation

◆ Circle() [1/2]

spark::core::components::Circle::Circle ( GameObject * parent)
inlineexplicit

Creates a new circle component . Defaults to a radius of 25.

Parameters
parentThe parent game object.

◆ Circle() [2/2]

spark::core::components::Circle::Circle ( GameObject * parent,
const float radius )
inlineexplicit

Creates a new circle component .

Parameters
radiusThe radius of the circle. (in pixels)
parentThe parent game object.

Member Function Documentation

◆ render()

void spark::core::components::Circle::render ( ) const
inlineoverridevirtual

Renders the component.

Reimplemented from spark::core::Component.