How to use Bitmap font as scene 2d actor?

后端 未结 2 938
日久生厌
日久生厌 2021-02-11 11:26

I am developing a game using libgdx framework. How can i achieve scene2d action on bitmap font object ? so that i can write some text like score,message and run action like scen

2条回答
  •  我在风中等你
    2021-02-11 12:06

    Take a look at the Label class, particularly the constructor that takes a CharSequence and a LabelStyle. When you initialize your LabelStyle you can supply a BitmapFont.

    Please note, if you'd like to scale or rotate the label you'll need to wrap it in a Container or add it to Table with setTransform() enabled. (This flushes the SpriteBatch so use it wisely.)

提交回复
热议问题