库GDX .绘制多行文本 [英] LibGDX . draw multiline text

查看:23
本文介绍了库GDX .绘制多行文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am trying to write a big text using BitmapFont in libGDX . But it shows on one line and the user can see only the first part of the text . How can I make that bitmapFont made new line automatically and show whole text on the screen ?

解决方案

Either use for manual new lines and render the font via font.drawMultiLine(...).

Or use font.drawWrapped(...) with a wrap width to let libgdx wrap it automatically (manually added are still supported).

Update:
With libGDX 1.6 the draw methods were enhanced, and there is no further need for drawMultiLine and drawWrapped, so those were removed. Draw methods can handle multiple lines and a new boolean wrap parameter was introduced.

这篇关于库GDX .绘制多行文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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