use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class CharSprite method worldCoords.
public PointF worldCoords() {
final int csize = DungeonTilemap.SIZE;
PointF point = point();
point.x = (point.x + width * 0.5f) / csize - 0.5f;
point.y = (point.y + height) / csize - 1.0f;
return point;
}
use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class PlantSprite method reset.
public void reset(Plant plant) {
revive();
reset(plant.image);
alpha(1f);
pos = plant.pos;
PointF p = DungeonTilemap.tileToWorld(plant.pos);
x = p.x;
y = p.y;
state = State.GROWING;
time = DELAY;
}
use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class BitmapTextMultiline method measure.
@Override
public void measure() {
SymbolWriter writer = new SymbolWriter();
PointF metrics = new PointF();
String[] paragraphs = PARAGRAPH.split(text);
for (int i = 0; i < paragraphs.length; i++) {
String[] words = WORD.split(paragraphs[i]);
for (int j = 0; j < words.length; j++) {
String word = words[j];
if (word.length() == 0) {
continue;
}
getWordMetrics(word, metrics);
writer.addSymbol(metrics.x, metrics.y);
writer.addSpace(spaceSize);
}
writer.newLine(0, font.lineHeight);
}
width = writer.width;
height = writer.height;
}
use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class LevelObjectSprite method fall.
public void fall() {
origin.set(width / 2, height - DungeonTilemap.SIZE / 2);
angularSpeed = Random.Int(2) == 0 ? -720 : 720;
getParent().add(new ScaleTweener(this, new PointF(0, 0), 1f) {
@Override
protected void onComplete() {
LevelObjectSprite.this.killAndErase();
}
@Override
protected void updateValues(float progress) {
super.updateValues(progress);
am = 1 - progress;
}
});
}
use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.
the class LevelObjectSprite method setLevelPos.
private void setLevelPos(int cell) {
PointF p = DungeonTilemap.tileToWorld(cell);
x = p.x + centerShift.x;
y = p.y + centerShift.y;
}
Aggregations