v0.3.4: changed floating text to use rendered font
This commit is contained in:
committed by
Evan Debenham
parent
5c064ae935
commit
970968ace2
@@ -22,15 +22,15 @@ package com.shatteredpixel.shatteredpixeldungeon.effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.watabou.noosa.BitmapText;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
import com.watabou.utils.SparseArray;
|
||||
|
||||
public class FloatingText extends BitmapText {
|
||||
public class FloatingText extends RenderedText {
|
||||
|
||||
private static final float LIFESPAN = 1f;
|
||||
private static final float DISTANCE = DungeonTilemap.SIZE;
|
||||
@@ -44,7 +44,6 @@ public class FloatingText extends BitmapText {
|
||||
private static SparseArray<ArrayList<FloatingText>> stacks = new SparseArray<ArrayList<FloatingText>>();
|
||||
|
||||
public FloatingText() {
|
||||
super();
|
||||
speed.y = - DISTANCE / LIFESPAN;
|
||||
}
|
||||
|
||||
@@ -84,14 +83,14 @@ public class FloatingText extends BitmapText {
|
||||
if (cameraZoom != Camera.main.zoom) {
|
||||
cameraZoom = Camera.main.zoom;
|
||||
PixelScene.chooseFont( 9, cameraZoom );
|
||||
font = PixelScene.font;
|
||||
scale.set( PixelScene.scale );
|
||||
size( 9 * (int)cameraZoom);
|
||||
scale.set( 1 /cameraZoom );
|
||||
}
|
||||
|
||||
text( text );
|
||||
hardlight( color );
|
||||
|
||||
measure();
|
||||
//measure();
|
||||
this.x = x - width() / 2;
|
||||
this.y = y - height();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user