@@ -56,6 +56,7 @@ public TextManagerUI(SceneScreen sceneScreen) {
56
56
this .sceneScreen = sceneScreen ;
57
57
setTouchable (Touchable .disabled );
58
58
style = sceneScreen .getUI ().getSkin ().get (TextManagerUIStyle .class );
59
+ style .font .setMarkupEnabled (true );
59
60
setVisible (false );
60
61
}
61
62
@@ -113,7 +114,6 @@ else if (posy == TextManager.POS_SUBTITLE)
113
114
114
115
setSize (b .width + PADDING * 2 , b .height + PADDING * 2 );
115
116
116
- style .font .setMarkupEnabled (true );
117
117
style .font .setColor (currentSubtitle .color );
118
118
119
119
// check if the text exits the screen
@@ -137,7 +137,12 @@ public void draw(Batch batch, float alpha) {
137
137
if (subtitle .type == Text .Type .TALK ) {
138
138
if (style .talkBubble != null ) {
139
139
float scale = DPIUtils .getTouchMinSize () / 4 / style .talkBubble .getMinHeight ();
140
- float bubbleX = getX () + (getWidth () - style .talkBubble .getMinWidth () * scale )/ 2 ;
140
+ // float bubbleX = getX() + (getWidth() - style.talkBubble.getMinWidth() * scale)/ 2;
141
+ unprojectTmp .set (subtitle .x , subtitle .y , 0 );
142
+ World .getInstance ().getSceneCamera ().scene2screen (sceneScreen .getViewport (), unprojectTmp );
143
+
144
+ float bubbleX = unprojectTmp .x - style .talkBubble .getMinWidth () * scale / 2 ;
145
+
141
146
float bubbleY = getY () - style .talkBubble .getMinHeight () * scale + 2 ;
142
147
143
148
// style.talkBubble.draw(batch, bubbleX, bubbleY, style.talkBubble.getMinWidth() * scale,
@@ -161,9 +166,9 @@ public void draw(Batch batch, float alpha) {
161
166
getWidth () - PADDING * 2 , HAlignment .CENTER );
162
167
}
163
168
164
- public void resize (int width , int height ) {
165
- maxRectangleWidth = width / 1.7f ;
166
- maxTalkWidth = width / 3 ;
169
+ public void resize (int width , int height ) {
170
+ maxRectangleWidth = Math . min ( width - DPIUtils . getMarginSize () * 2 , style . font . getSpaceWidth () * 80 ) ;
171
+ maxTalkWidth = Math . min ( width - DPIUtils . getMarginSize () * 2 , style . font . getSpaceWidth () * 35 ) ;
167
172
}
168
173
169
174
/** The style for the TextManagerUI */
0 commit comments