v3.2.0: fixed floating text stacking to use visual logic entirely
This commit is contained in:
@@ -201,8 +201,9 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
|
||||
}
|
||||
float x = destinationCenter().x;
|
||||
float y = destinationCenter().y - height()/2f;
|
||||
int pos = DungeonTilemap.worldToTile(x, y + height(), Dungeon.level.width());
|
||||
if (ch != null) {
|
||||
FloatingText.show( x, y, ch.pos, text, color, icon, true );
|
||||
FloatingText.show( x, y, pos, text, color, icon, true );
|
||||
} else {
|
||||
FloatingText.show( x, y, -1, text, color, icon, true );
|
||||
}
|
||||
|
||||
@@ -165,6 +165,10 @@ public abstract class DungeonTilemap extends Tilemap {
|
||||
(pos % Dungeon.level.width() + 0.5f) * SIZE,
|
||||
(pos / Dungeon.level.width() + 0.1f) * SIZE );
|
||||
}
|
||||
|
||||
public static int worldToTile( float x, float y, int width){
|
||||
return (int)(x / SIZE) + ((int)(y / SIZE) * width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean overlapsScreenPoint( int x, int y ) {
|
||||
|
||||
Reference in New Issue
Block a user