5#include "UIComponent.h"
46 Slider(std::string sliderKnobKey, std::string sliderBarKey);
Represents a sprite in the SUNENGINE.
Definition Sprites/SUNENGINESprite.h:16
float GetAngle() const
Gets the angle of the slider in radians.
Definition Slider.cpp:80
SUNENGINESprite * pKnobSprite
Sprite for the slider knob.
Definition Slider.h:143
void SetLayer(int layer) override
Sets the rendering layer of the slider.
Definition Slider.cpp:141
void SetAngleRadians(float rad)
Sets the angle of the slider in radians.
Definition Slider.cpp:48
void Render() override
Renders the slider (bar and knob).
Definition Slider.cpp:134
Matrix trans
Transformation matrix.
Definition Slider.h:145
float GetWidth() const
Gets the width of the slider (bar) in pixels.
Definition Slider.cpp:70
void SetAngleDegrees(float deg)
Sets the angle of the slider in degrees.
Definition Slider.cpp:53
bool IsMouseOver(float xPos, float yPos) override
Checks if the mouse is over the slider.
Definition Slider.cpp:155
UICommand * pOnPressCommand
Command to execute when the slider is pressed.
Definition Slider.h:154
float GetValue() const
Gets the current value of the slider (0.0 to 1.0).
Definition Slider.cpp:101
void UpdateWorld()
Updates the world matrix of the slider.
Definition Slider.cpp:183
float posY
Y position of the slider center.
Definition Slider.h:149
float GetScaleX() const
Gets the x-scale factor of the slider.
Definition Slider.cpp:85
float angle
Angle of the slider in radians.
Definition Slider.h:150
void SetOrigin(float x, float y)
Sets the origin of the slider (for transformations).
Definition Slider.cpp:35
Matrix rot
Rotation matrix.
Definition Slider.h:146
Matrix scale
Scale matrix.
Definition Slider.h:147
void OnPress() override
Handles press events (mouse interaction) for the slider.
Definition Slider.cpp:106
float scaleX
X scale factor.
Definition Slider.h:151
SUNENGINESprite * pBarSprite
Sprite for the slider bar.
Definition Slider.h:144
float GetHeight() const
Gets the height of the slider (bar) in pixels.
Definition Slider.cpp:75
float posX
X position of the slider center.
Definition Slider.h:148
float GetScaleY() const
Gets the y-scale factor of the slider.
Definition Slider.cpp:90
void SetPosition(float x, float y)
Sets the position of the slider.
Definition Slider.cpp:42
void SetOnPressCommand(UICommand *cmd)
Sets the command to be executed when the slider is pressed.
Definition Slider.cpp:146
void SetScaleFactor(float x, float y)
Sets the scale factor of the slider.
Definition Slider.cpp:58
void SetValue(float value)
Sets the value of the slider (0.0 to 1.0).
Definition Slider.cpp:95
void SetScalePixel(float x, float y)
Sets the scale of the slider in pixels.
Definition Slider.cpp:64
float value
Current value of the slider (0.0 to 1.0).
Definition Slider.h:153
Slider()=default
Default constructor.
float scaleY
Y scale factor.
Definition Slider.h:152
Abstract base class for UI-related command objects.
Definition UICommand.h:32
Abstract base class for all UI components.
Definition UIComponent.h:32