GetPath
Returns the file path the Asset was loaded from.
Syntax
Returns
Returns the asset's file path.
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);
World* world = World::Create();
Camera* camera = Camera::Create();
DirectionalLight::Create()->SetRotation(35, 45, 0);
//Load an asset
Texture* texture = Texture::Load("Materials/Grass/grass01.tex");
while (true)
{
if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Time::Update();
world->Update();
world->Render();
//Display the asset name on screen
context->SetBlendMode(Blend::Alpha);
context->DrawText(texture->GetPath(), 2, 2);
context->SetBlendMode(Blend::Solid);
//Draw the texture on screen
context->DrawImage(texture, 0, 20);
context->Sync();
}
return 0;
}