c4c582d739
* custom implementation for wi::vector * fix * sdl vulkan fix * linux fix * fix * vector fix * shader compiler and job system will be initialized automatically on first use * vector improvements * updates * update * network and audio will be auto initializing on first use only * fix * for now, use std::vector * vector refactor minor * backlog: access safety * shader clearcoat fix * gui initialization on demand * initializer updates * job system will be explicitly initialized
65 lines
1.1 KiB
C++
65 lines
1.1 KiB
C++
#include "wiSpriteFont.h"
|
|
#include "wiHelper.h"
|
|
|
|
using namespace wi::graphics;
|
|
|
|
namespace wi
|
|
{
|
|
|
|
void SpriteFont::FixedUpdate()
|
|
{
|
|
if (IsDisableUpdate())
|
|
return;
|
|
}
|
|
void SpriteFont::Update(float dt)
|
|
{
|
|
if (IsDisableUpdate())
|
|
return;
|
|
}
|
|
|
|
void SpriteFont::Draw(CommandList cmd) const
|
|
{
|
|
if (IsHidden())
|
|
return;
|
|
wi::font::Draw(text, params, cmd);
|
|
}
|
|
|
|
float SpriteFont::TextWidth() const
|
|
{
|
|
return wi::font::TextWidth(text, params);
|
|
}
|
|
float SpriteFont::TextHeight() const
|
|
{
|
|
return wi::font::TextHeight(text, params);
|
|
}
|
|
|
|
void SpriteFont::SetText(const std::string& value)
|
|
{
|
|
wi::helper::StringConvert(value, text);
|
|
}
|
|
void SpriteFont::SetText(std::string&& value)
|
|
{
|
|
wi::helper::StringConvert(value, text);
|
|
}
|
|
void SpriteFont::SetText(const std::wstring& value)
|
|
{
|
|
text = value;
|
|
}
|
|
void SpriteFont::SetText(std::wstring&& value)
|
|
{
|
|
text = std::move(value);
|
|
}
|
|
|
|
std::string SpriteFont::GetTextA() const
|
|
{
|
|
std::string retVal;
|
|
wi::helper::StringConvert(text, retVal);
|
|
return retVal;
|
|
}
|
|
const std::wstring& SpriteFont::GetText() const
|
|
{
|
|
return text;
|
|
}
|
|
|
|
}
|