Latest version:
Tramway SDK 0.0.9
Github
Quick links
Home
Get Started

Sprite Component


This EntityComponent displays a sprite.

If the spritesheet contains multiple sprites, it's possible to play them as an animation. Very neat!

Programming in C++


#include <components/sprite.h>
API documentation page.

To get started, construct the component, feed it a sprite and set its location. It might take a few moments for the sprite to be streamed in.

Component<SpriteComponent> component;

component.make();
component->SetSprite(Sprite::Find("poland"));
comopennt->UpdateLocation({3.0f, 1.2f, -1.0f});
component->Init();

If you want to play the spritesheet as an animation.

component->SetPlaySpeed(2);
component->Play();


Scripting in Lua


Eventually it will be finished, but might take some time.