← API Reference Namespace

asge::game::components

Namespaces

Classes & Structs

Enumerations

#enum class ResolutionType

How CollisionSystem react to an overlap involving this Collider.

Unknown
Trigger
Solid
#enum class VerticalAlign

How Draw(UILabel) positions text within its UIRect's height Top sits the text at the rect's own top edge, same as before this existed.

Top
Center
Bottom
#enum class SlotAlign

Where a child sits along one axis of a layout slot it doesn't fill.

Start
Center
End
#enum class PanelLayout

Which LayoutSpec alternative a panel uses; also its serialized m_LayoutType name.

Absolute
Grid
VStack
HStack

Typedefs

Every component type with a Serializer<T> specialization.

The one place a scene (de)serializer needs to know about — for each entity, it folds over this list checking Registry::HasComponent<T> (to save) or TOMLTableView::HasTable(Serializer<T>::kTableName) (to load) for each T, rather than requiring any actual reflection. Adding a new serializable component means adding its type here, alongside its own Serializer<T> specialization.

#using UIComponents = std::tuple< UIButton, UIRect, Interactable, UILabel, UICheckbox, UISlider, UIPanel, UILayoutItem >

Every component type belonging to the UI subsystem.

#using ColliderShape = std::variant< math::Rect, math::Circle >

The set of shapes a Collider can be — see AabbOverlap/PenetrationVector (Collision.hpp).

#using CollisionLayer = std::uint32_t

A bitmask identifying/filtering which Colliders can collide with which — see Collider::m_Layer/m_Mask and LayersCanCollide.

#using LayoutSpec = std::variant< LayoutAbsolute, LayoutGrid, LayoutVStack, LayoutHStack >

The panel's layout mode together with that mode's parameters.

Variables

#constexpr PanelLayout LayoutType_v = LayoutType<T>::value
#static constexpr float kTrackBarSize = 0.30f

Fraction of a slider's height left empty above and below its track bar.

Functions

#void PlayAnimation(Animation &inAnim, bool inLoop=true) noexcept

Resumes/starts playback from the current frame — does not reset m_CurrentFrame or m_ElapsedTime, so calling this on an already in-progress Animation continues rather than restarts it.

#bool PlayClip(Animation &inAnim, str::StringView inName, bool inLoop=true) noexcept

Switches to the clip registered as inName in inAnim.m_Clips: points m_ClipPath at it and restarts playback from frame 0, looping or not per inLoop.

Does nothing if that clip is already playing, so calling it every frame is safe. Returns false for an unknown name.

#void StopAnimation(Animation &inAnim) noexcept

Pauses playback in place; AnimationSystem stops advancing this Animation until PlayAnimation is called again.

#void PlayAudioSource(AudioSource &inAudioSource, bool inLoop=true) noexcept

Marks inAudioSource to (re)start playing right away, looping per inLoop once it runs out of queued audio.

Safe to call whether inAudioSource is stopped, already playing, or still mid-loop AudioSystem always honors the request on its next pass by restarting from the beginning of the clip, reusing the existing stream rather than creating a new one. inLoop only governs what happens if this playthrough runs out on its own; it plays independently of it either way.

#void StopAudioSource(AudioSource &inAudioSource) noexcept

Marks inAudioSource to stop; AudioSystem clears its queued audio on the next pass.

#BoolResult DetachAudioSource(audio::AudioDevice &inDevice, AudioSource &inAudioSource) noexcept

Releases inAudioSource's stream back to inDevice's pool and clears m_Stream, so a later PlayAudioSource creates a fresh one instead of reusing it.

A no-op returning BoolResult::Ok() if inAudioSource has no stream yet. Unlike StopAudioSource, this actually frees the underlying pool slot for other sources to use reach for it when a source is done for good (e.g. its entity is being destroyed), not just paused.

#void SetVolume(AudioSource &inAudioSource, float inVolume) noexcept

Set the audio source gain/volume.

#bool LayersCanCollide(Collider const &inA, Collider const &inB) noexcept

Whether two Colliders are even willing to collide with each other, before either's actual shape/overlap is looked at — see systems::CollisionSystem, which skips a pair entirely on false.

Mutual: inA's layer must be in inB's mask and inB's layer must be in inA's mask, so one side excluding the other is enough to skip the pair regardless of what the other side's mask says.

#bool HasUnknownResolution(Collider const &inCollider) noexcept

Returns True if input collider has unknown resolution type.

#void AttachChild(ecs::Registry &inReg, ecs::Entity inParent, ecs::Entity inChild)
#void DetachChild(ecs::Registry &inReg, ecs::Entity inChild)
#void RebuildPath(PathFollow &inPathFollow) noexcept

Rebuilds inPathFollow.m_Path from its current m_Waypoints/ m_Resolution and resets m_Traveled/m_Finished back to their defaults.

asset::Resolver<PathFollow> only ever builds m_Path once (see its own doc comment) — correct for a component that's just been loaded from a scene file, but wrong the moment something mutates m_Waypoints/m_Resolution afterward (the level editor's viewport waypoint editing, say), which would otherwise leave m_Path silently pointing at the old shape. Call this any time you mutate either field directly instead of relying on ResolveAssets to notice.

#SpriteDrawCorners SpriteGetDrawCorners(math::Rect const &inDstRect, float inRotationRadians) noexcept

inDstRect's own corners (as utils::SpriteGetDstRect returns), rotated inRotationRadians around inDstRect's center.

Positive inRotationRadians rotates clockwise on screen (screen-space Y grows downward); inRotationRadians == 0 reproduces inDstRect's unrotated corners exactly. Feeds IRenderer::DrawTextureAffine, the only DrawTexture* overload that can express rotation — see RenderSystem, which switches to it whenever a drawn entity's Transform::m_WorldRotation is non-zero.

#str::String ToString(VerticalAlign inAlign) noexcept

VerticalAlign -> its lowercase TOML/display representation ("top" for anything unrecognized).

#VerticalAlign FromString(str::StringView inStr) noexcept

The read-side counterpart to ToString any string other than "top"/"center"/"bottom" maps to Top.

#PanelLayout GetPanelLayout(UIPanel const &inPanel) noexcept
#float GetStep(UISlider const &inSlider, float inWidth) noexcept

Value units covered per pixel of a track inWidth wide, i.e.

(m_Max - m_Min) / inWidth.

#math::Float2 GetThumbPosition(UISlider const &inSlider, math::Rect inOrigin) noexcept

Thumb center inside inOrigin: m_Value mapped (clamped to the range) along its width, vertically centered.