ToString
Converts an Object into a human-readable string for debugging, file IO, or other purposes. The Vec3 class, for example, will return a string in the format "x, y, z".
Syntax
- string Object::ToString()
Returns
A human-readable string describing the object.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
context->SetColor(0, 0, 0, 0);
context->Clear();
//Create an object
AABB aabb = AABB(-10, -10, -10, 10, 10, 10);
context->SetColor(1, 1, 1, 1);
context->SetBlendMode(Blend::Alpha);
context->DrawText(aabb.ToString(), 2, 2);
context->SetBlendMode(Blend::Solid);
context->Sync();
}
}