fairygui / FairyGUI-cocos2dx

A flexible UI framework for Cocos2d-x
https://www.fairygui.com
MIT License
473 stars 109 forks source link

FairyGUI problems with text update #112

Closed paulocoutinhox closed 6 months ago

paulocoutinhox commented 6 months ago

Steps to Reproduce:

  1. Create a FairGUI GTextField element with any custom font and a simple text, example "test"
  2. Change the text of GTextField in runtime with characters that is not in original text, example "text"

BEFORE CHANGE TEXT

image

AFTER CHANGE TEXT

image

The letter "x" that is not in design mode don't appear when new text have it.

Code:

auto lbMessage = dynamic_cast<fairygui::GTextField *>(getContentPane()->getChild("lbMessage"));
lbMessage->setText("text");

What is wrong?

paulocoutinhox commented 6 months ago

I solve the problems settings correct resolution in design resolution and the text problems is related to threads, because i call JNI somethings and it don't render when come from JNI call (i dont know why, but i call on callback the method runInAxmolThread). Thanks.