Slider text fixed

This commit is contained in:
maverickdgg 2023-02-27 10:28:20 +08:00
parent db8ed27cb7
commit 984473bdab
6 changed files with 16 additions and 8 deletions

View File

@ -21,8 +21,8 @@ namespace SHADE_Scripting.UI
TextRenderable text = GetComponent<TextRenderable>();
if(slider != null && text != null)
{
Debug.Log("SETTING TEXT");
text.Text = (slider.GetValue() * (maxValue - minValue) + minValue).ToString();
text.Text = ((int)(slider.GetValue() * (maxValue - minValue) + minValue)).ToString();
}
}

View File

@ -30,18 +30,24 @@ of DigiPen Institute of Technology is prohibited.
#include "Graphics\MiddleEnd\Interface\SHRenderable.h"
#include "Graphics\MiddleEnd\TextRendering\SHTextRenderableComponent.h"
#include "UI\SHUIComponent.h"
#include "UI\SHSliderComponent.h"
#include "UI\SHCanvasComponent.h"
// Project Headers
#include "Utility/Convert.hxx"
#include "Utility/Debug.hxx"
#include "Components/Transform.hxx"
#include "Components/RigidBody.hxx"
#include "Components/Collider.hxx"
#include "Components/Camera.hxx"
#include "Components/CameraArm.hxx"
#include "Components/Light.hxx"
#include "Components\Transform.hxx"
#include "Components\RigidBody.hxx"
#include "Components\Collider.hxx"
#include "Components\Camera.hxx"
#include "Components\CameraArm.hxx"
#include "Components\Light.hxx"
#include "Components\Renderable.hxx"
#include "Components\TextRenderable.hxx"
#include "Components\UIElement.hxx"
#include "Components\Canvas.hxx"
#include "Components\Slider.hxx"
namespace SHADE
{
@ -327,6 +333,8 @@ namespace SHADE
componentMap.Add(createComponentSet<SHLightComponent, Light>());
componentMap.Add(createComponentSet<SHTextRenderableComponent, TextRenderable>());
componentMap.Add(createComponentSet<SHUIComponent, UIElement>());
componentMap.Add(createComponentSet<SHCanvasComponent, Canvas>());
componentMap.Add(createComponentSet<SHSliderComponent, Slider>());
}
/*---------------------------------------------------------------------------------*/