iibrahimbakr
iibrahimbakr

Reputation: 1134

libGDX : get Label actor from stage by name

My Actor is Label. When I get it by name, I don't find setText(...); method.

I used :

stage.getRoot().findActor("name"). // setText not exist

How can I find the Label actor ?

Upvotes: 0

Views: 462

Answers (1)

TomGrill Games
TomGrill Games

Reputation: 1593

You probably need to cast to Label before using:

Label labelActor = (Label) stage.getRoot().findActor("name");
labelActor.setText("abc");

Upvotes: 2

Related Questions