LkEngine 0.1.2
 
Loading...
Searching...
No Matches
Slider.h File Reference

Slider widgets. More...

#include "LkEngine/Core/LObject/Enum.h"
#include "LkEngine/Core/Delegate/Delegate.h"
#include "LkEngine/Renderer/UI/UICore.h"
#include "LkEngine/Editor/EditorCore.h"
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>

Go to the source code of this file.

Namespaces

namespace  LkEngine
 
namespace  LkEngine::UI::Slider
 

Functions

FORCEINLINE bool LkEngine::UI::Draw::DragFloat (const char *Label, float *Value, float ValueSpeed=1.0f, float ValueMin=0.0f, float ValueMax=0.0f, const char *Format="%.3f", ImGuiSliderFlags Flags=0)
 
FORCEINLINE bool LkEngine::UI::Draw::DragFloat3 (const char *Label, float Vec[3], float VecSpeed=1.0f, float VecMin=0.0f, float VecMax=0.0f, const char *Format="%.3f", ImGuiSliderFlags Flags=0)
 
FORCEINLINE bool LkEngine::UI::Draw::DragFloat4 (const char *Label, float Vec[4], float VecSpeed=1.0f, float VecMin=0.0f, float VecMax=0.0f, const char *Format="%.3f", ImGuiSliderFlags Flags=0)
 
FORCEINLINE bool LkEngine::UI::Draw::SliderFloat3 (const char *Label, float Vec[3], float VecMin, float VecMax, const char *Format="%.3f", ImGuiSliderFlags Flags=0)
 
template<EVectorSemantic VecSemantic = EVectorSemantic::XYZW, typename VectorType = glm::vec3>
FORCEINLINE bool LkEngine::UI::Draw::Vec3Control (const std::string &Label, VectorType &Values, const float ResetValue=0.0f, const float ValueSpeed=0.10f, const float ValueMin=0.0f, const float ValueMax=0.0f, const float ColumnWidth=100.0f, uint32_t RenderMultiSelectAxes=0, const char *Format="%.2f")
 Slider widget for three-component vectors.
 
template<EVectorSemantic VecSemantic = EVectorSemantic::XYZW, typename VectorType = ImVec4>
FORCEINLINE bool LkEngine::UI::Draw::Vec4Control (const std::string &Label, VectorType &Values, const float ValueSpeed=0.10f, const float ResetValue=0.0f, const float ValueMin=0.0f, const float ValueMax=0.0f, const float ColumnWidth=100.0f, const char *Format="%.2f", uint32_t RenderMultiSelectAxes=0)
 
enum class  LkEngine::UI::EVectorSemantic { XYZ , RGB , XYZW , RGBA }
 
 LkEngine::UI::LK_ENUM_CLASS (EVectorSemantic)
 

Detailed Description

Slider widgets.

Function Documentation

◆ Vec3Control()

template<EVectorSemantic VecSemantic = EVectorSemantic::XYZW, typename VectorType = glm::vec3>
FORCEINLINE bool LkEngine::UI::Draw::Vec3Control ( const std::string & Label,
VectorType & Values,
const float ResetValue = 0.0f,
const float ValueSpeed = 0.10f,
const float ValueMin = 0.0f,
const float ValueMax = 0.0f,
const float ColumnWidth = 100.0f,
uint32_t RenderMultiSelectAxes = 0,
const char * Format = "%.2f" )

Slider widget for three-component vectors.

Template Parameters
VecSemanticSemantics to display.
VectorTypeThe vector type (deduced).
Parameters
LabelText to display next to the widget.
ValuesReference to the vector.
ResetValueValue to reset an axis to when clicking on it.
ValueSpeedSpeed to increment/decrement the slider value.
ValueMinMinimum allowed value, cannot go lower.
ValueMaxMaximum allowed value, cannot go higher.
ColumnWidthWidth of a single column.
RenderMultiSelectAxesFlags for rendering multiple select axes.
FormatString format used for displaying the values.
Returns
true if the vector was modified, else false.
Todo
: Should ManuallyEdited be removed alltogether?

◆ Vec4Control()

template<EVectorSemantic VecSemantic = EVectorSemantic::XYZW, typename VectorType = ImVec4>
FORCEINLINE bool LkEngine::UI::Draw::Vec4Control ( const std::string & Label,
VectorType & Values,
const float ValueSpeed = 0.10f,
const float ResetValue = 0.0f,
const float ValueMin = 0.0f,
const float ValueMax = 0.0f,
const float ColumnWidth = 100.0f,
const char * Format = "%.2f",
uint32_t RenderMultiSelectAxes = 0 )

Vec4Control

Slider for 4 different values.