Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
ICmpOverlayRenderer Class Referenceabstract

Interface for rendering 'overlay' objects (typically sprites), automatically positioned relative to the entity. More...

#include <ICmpOverlayRenderer.h>

Inheritance diagram for ICmpOverlayRenderer:
Collaboration diagram for ICmpOverlayRenderer:

Public Member Functions

virtual void Reset ()=0
 Delete all sprites that have been previously added. More...
 
virtual void AddSprite (const VfsPath &textureName, const CFixedVector2D &corner0, const CFixedVector2D &corner1, const CFixedVector3D &offset, const std::string &color="255 255 255 255")=0
 Add a new textured billboard sprite to be rendered. More...
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=0
 
virtual void Deinit ()=0
 
virtual void HandleMessage (const CMessage &msg, bool global)
 
CEntityHandle GetEntityHandle () const
 
void SetEntityHandle (CEntityHandle ent)
 
entity_id_t GetEntityId () const
 
CEntityHandle GetSystemEntity () const
 
const CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
virtual bool NewJSObject (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const
 Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More...
 
virtual JS::Value GetJSInstance () const
 
virtual int GetComponentTypeId () const =0
 

Static Public Member Functions

static void SetOverrideVisibility (bool visible)
 Enables or disables rendering of all sprites. More...
 
- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static void RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static void RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
 
static u8 GetSerializationVersion ()
 

Static Protected Attributes

static bool m_OverrideVisible = true
 

Additional Inherited Members

- Public Types inherited from IComponent
using AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor)
 
using DeallocFunc = void(*)(IComponent *)
 

Detailed Description

Interface for rendering 'overlay' objects (typically sprites), automatically positioned relative to the entity.

Usually driven by the StatusBars component.

(TODO: maybe we should add a "category" argument to Reset/AddSprite/etc, so different components can each maintain independent sets of overlays here?)

Member Function Documentation

◆ AddSprite()

virtual void ICmpOverlayRenderer::AddSprite ( const VfsPath textureName,
const CFixedVector2D corner0,
const CFixedVector2D corner1,
const CFixedVector3D offset,
const std::string &  color = "255 255 255 255" 
)
pure virtual

Add a new textured billboard sprite to be rendered.

Parameters
textureNamefilename of texture to render.
corner0,corner1coordinates of sprite's corners, in world-space units oriented with the camera plane, relative to the sprite position.
offsetworld-space offset of sprite position from the entity's base position.
colormultiply color of texture

Implemented in CCmpOverlayRenderer.

◆ Reset()

virtual void ICmpOverlayRenderer::Reset ( )
pure virtual

Delete all sprites that have been previously added.

Implemented in CCmpOverlayRenderer.

◆ SetOverrideVisibility()

static void ICmpOverlayRenderer::SetOverrideVisibility ( bool  visible)
inlinestatic

Enables or disables rendering of all sprites.

Parameters
visibleWhether the selectable should be visible.

Member Data Documentation

◆ m_OverrideVisible

bool ICmpOverlayRenderer::m_OverrideVisible = true
staticprotected

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