如何使用位图字体作为场景2d演员? [英] How to use Bitmap font as scene 2d actor?

查看:89
本文介绍了如何使用位图字体作为场景2d演员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用libgdx框架开发游戏.如何在位图字体对象上实现scene2d动作?这样我就可以写一些诸如乐谱,消息之类的文本,并执行诸如scene2d actor之类的动作.

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 scene2d actor.

推荐答案

看看

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.)

这篇关于如何使用位图字体作为场景2d演员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆