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 java.util.ArrayList;
|
||||||
|
|
||||||
import com.watabou.noosa.BitmapText;
|
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
|
import com.watabou.noosa.RenderedText;
|
||||||
import com.watabou.utils.SparseArray;
|
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 LIFESPAN = 1f;
|
||||||
private static final float DISTANCE = DungeonTilemap.SIZE;
|
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>>();
|
private static SparseArray<ArrayList<FloatingText>> stacks = new SparseArray<ArrayList<FloatingText>>();
|
||||||
|
|
||||||
public FloatingText() {
|
public FloatingText() {
|
||||||
super();
|
|
||||||
speed.y = - DISTANCE / LIFESPAN;
|
speed.y = - DISTANCE / LIFESPAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,14 +83,14 @@ public class FloatingText extends BitmapText {
|
|||||||
if (cameraZoom != Camera.main.zoom) {
|
if (cameraZoom != Camera.main.zoom) {
|
||||||
cameraZoom = Camera.main.zoom;
|
cameraZoom = Camera.main.zoom;
|
||||||
PixelScene.chooseFont( 9, cameraZoom );
|
PixelScene.chooseFont( 9, cameraZoom );
|
||||||
font = PixelScene.font;
|
size( 9 * (int)cameraZoom);
|
||||||
scale.set( PixelScene.scale );
|
scale.set( 1 /cameraZoom );
|
||||||
}
|
}
|
||||||
|
|
||||||
text( text );
|
text( text );
|
||||||
hardlight( color );
|
hardlight( color );
|
||||||
|
|
||||||
measure();
|
//measure();
|
||||||
this.x = x - width() / 2;
|
this.x = x - width() / 2;
|
||||||
this.y = y - height();
|
this.y = y - height();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user