TextField in cocos2d-x 3.0 with background image, text alignment and colored shadow

醉酒当歌 提交于 2019-12-24 00:23:32

问题


I need a input text filed with:

  1. background image
  2. text aligned to center
  3. text color, shadow and shadow color options

But I cannot find and appropriate one. I have investigated and found:

  • cocos2d::extension::EditBox which has 1, but 2 and 3 are missing as I understand
  • cocos2d::TextFieldTTF
  • ui::UICCTextField
  • ui::TextField

The latest 3 ones don't have 2 and 3 and also are not easy to use in terms of getting input.

cocos2d::Label seams to hove what I want (I can use a sprite for background), but it is not for input. What solution suggests cocos2d-x?


回答1:


Now there is no way to do this not considering a new TextField definition. But cocos2d-x guys are going to merge TextField with UI system and maybe at that time it will support such features. See here: http://www.cocos2d-x.org/issues/5346#change-12942



来源:https://stackoverflow.com/questions/23846780/textfield-in-cocos2d-x-3-0-with-background-image-text-alignment-and-colored-sha

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!