Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
0
Members

Show text variable in game

A topic by Zezik created Jan 22, 2016 Views: 656 Replies: 2
Viewing posts 1 to 3

Hi guys,

sorry for my English, I need help with text variable in game (score). I am beginner in programming and TypeScript API Browser is not helping me very much :(

Can you please give me a simple example how to do it? Thank you :)

Moderator

For starters, you'll need to create an actor in a scene and put a TextRenderer component on it. Then create a font asset and put it on the text renderer.

Then, in some behavior, you can update the text renderer's displayed text like so:

Sup.getActor("My Actor").textRenderer.setText(someVariable);

Thanks man,

Sup.getActor("My Actor").textRenderer.setText(someVariable);

is exactly what I was looking for :)