Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Components::WidgetComponent Class Reference

#include <WidgetComponent.h>

Inheritance diagram for Engine::Components::WidgetComponent:
Collaboration diagram for Engine::Components::WidgetComponent:

Classes

struct  Resolution

Public Member Functions

 WidgetComponent (Entities::Scene *scene)
std::string getComponentName () const override
 Gets the component type name for debugging/UI.
Resolution getRequestedResolution () const
void setRequestedResolution (uint32_t width, uint32_t height)
bool isWorldUiActive () const
void setWorldUiActive (bool active)
uint32_t getWorldUiDescriptorIndex () const
void setWorldUiDescriptorIndex (uint32_t descriptorIndex)
void clearWorldUiDescriptorIndex ()
virtual void drawRuntimeImGui ()
void selectNextUpgrade ()
void selectPreviousUpgrade ()
void buySelectedUpgrade ()
Public Member Functions inherited from Engine::Components::Logic
 Logic (Entities::Scene *owningScene)
 Logic (const Entities::SpawnContext &context)
virtual ~Logic ()=default
virtual bool drawImGui ()
 Draws component-specific ImGui inspector controls.
virtual bool drawImGuiName ()
 Used to alter the name of the entity in the outliner.
virtual void beginPlay ()
 Called when the component is added to the scene or the game starts.
virtual void tick (double deltaTime)
 Called every frame if ticking is enabled.
virtual void endPlay ()
 Called when the component is removed or the game ends.
bool hasBegunPlay () const
bool canTick () const
 Checks if the component is currently set to tick.
void setCanTick (bool enable)
 Enables or disables ticking for this component.
Entities::EntitygetOwningEntity () const
 Gets the entity this component belongs to.

Static Public Attributes

static constexpr bool IsUnique = false
Static Public Attributes inherited from Engine::Components::Logic
static constexpr bool IsUnique = false
 Defines whether multiple instances of this component can exist on the same entity. Defaults to false (multiple allowed). Override in derived classes with static constexpr bool IsUnique = true; if needed.
static constexpr const char * ComponentName = "Logic"
 Fallback component type name. Derived classes may override getComponentName() for custom labels.

Private Attributes

Resolution resolution_ {}
bool active_ = true
uint32_t descriptorIndex_ = std::numeric_limits<uint32_t>::max()
int selectedUpgrade_ = 0
int credits_ = 120
int purchaseCount_ = 0

Additional Inherited Members

Protected Member Functions inherited from Engine::Components::Logic
Entities::ScenegetScene () const
 Gets the scene this component belongs to.
Core::SceneManagergetSceneManager () const
 Helper to get the SceneManager from the owning scene.

Detailed Description

Runtime ImGui widget that can be rendered into a world-space UI texture. Interaction is driven by gameplay/physical button code mutating this state.

Definition at line 15 of file WidgetComponent.h.

Constructor & Destructor Documentation

◆ WidgetComponent()

Engine::Components::WidgetComponent::WidgetComponent ( Entities::Scene * scene)
explicit

Member Function Documentation

◆ buySelectedUpgrade()

void Engine::Components::WidgetComponent::buySelectedUpgrade ( )

◆ clearWorldUiDescriptorIndex()

void Engine::Components::WidgetComponent::clearWorldUiDescriptorIndex ( )

◆ drawRuntimeImGui()

virtual void Engine::Components::WidgetComponent::drawRuntimeImGui ( )
virtual

◆ getComponentName()

std::string Engine::Components::WidgetComponent::getComponentName ( ) const
nodiscardoverridevirtual

Gets the component type name for debugging/UI.

Returns
The component display name.

Reimplemented from Engine::Components::Logic.

◆ getRequestedResolution()

Resolution Engine::Components::WidgetComponent::getRequestedResolution ( ) const
nodiscard

◆ getWorldUiDescriptorIndex()

uint32_t Engine::Components::WidgetComponent::getWorldUiDescriptorIndex ( ) const
nodiscard

◆ isWorldUiActive()

bool Engine::Components::WidgetComponent::isWorldUiActive ( ) const
nodiscard

◆ selectNextUpgrade()

void Engine::Components::WidgetComponent::selectNextUpgrade ( )

◆ selectPreviousUpgrade()

void Engine::Components::WidgetComponent::selectPreviousUpgrade ( )

◆ setRequestedResolution()

void Engine::Components::WidgetComponent::setRequestedResolution ( uint32_t width,
uint32_t height )

◆ setWorldUiActive()

void Engine::Components::WidgetComponent::setWorldUiActive ( bool active)

◆ setWorldUiDescriptorIndex()

void Engine::Components::WidgetComponent::setWorldUiDescriptorIndex ( uint32_t descriptorIndex)

Member Data Documentation

◆ active_

bool Engine::Components::WidgetComponent::active_ = true
private

Definition at line 48 of file WidgetComponent.h.

◆ credits_

int Engine::Components::WidgetComponent::credits_ = 120
private

Definition at line 52 of file WidgetComponent.h.

◆ descriptorIndex_

uint32_t Engine::Components::WidgetComponent::descriptorIndex_ = std::numeric_limits<uint32_t>::max()
private

Definition at line 49 of file WidgetComponent.h.

◆ IsUnique

bool Engine::Components::WidgetComponent::IsUnique = false
staticconstexpr

Definition at line 24 of file WidgetComponent.h.

◆ purchaseCount_

int Engine::Components::WidgetComponent::purchaseCount_ = 0
private

Definition at line 53 of file WidgetComponent.h.

◆ resolution_

Resolution Engine::Components::WidgetComponent::resolution_ {}
private

Definition at line 47 of file WidgetComponent.h.

◆ selectedUpgrade_

int Engine::Components::WidgetComponent::selectedUpgrade_ = 0
private

Definition at line 51 of file WidgetComponent.h.


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