use of com.watabou.utils.PointF in project pixel-dungeon by watabou.
the class Compass method update.
@Override
public void update() {
super.update();
if (!visible) {
visible = Dungeon.level.visited[cell] || Dungeon.level.mapped[cell];
}
if (visible) {
PointF scroll = Camera.main.scroll;
if (!scroll.equals(lastScroll)) {
lastScroll.set(scroll);
PointF center = Camera.main.center().offset(scroll);
angle = (float) Math.atan2(cellCenter.x - center.x, center.y - cellCenter.y) * RAD_2_G;
}
}
}
use of com.watabou.utils.PointF in project PD-classes by watabou.
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++) {
if (j > 0) {
writer.addSpace(spaceSize);
}
String word = words[j];
if (word.length() == 0) {
continue;
}
getWordMetrics(word, metrics);
writer.addSymbol(metrics.x, metrics.y);
}
writer.newLine(0, font.lineHeight);
}
width = writer.width;
height = writer.height;
nLines = writer.nLines();
}
use of com.watabou.utils.PointF in project pixel-dungeon by watabou.
the class MobSprite method fall.
public void fall() {
origin.set(width / 2, height - DungeonTilemap.SIZE / 2);
angularSpeed = Random.Int(2) == 0 ? -720 : 720;
parent.add(new ScaleTweener(this, new PointF(0, 0), FALL_TIME) {
@Override
protected void onComplete() {
MobSprite.this.killAndErase();
parent.erase(this);
}
@Override
protected void updateValues(float progress) {
super.updateValues(progress);
am = 1 - progress;
}
});
}
use of com.watabou.utils.PointF in project shattered-pixel-dungeon-gdx by 00-Evan.
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++) {
if (j > 0) {
writer.addSpace(spaceSize);
}
String word = words[j];
if (word.length() == 0) {
continue;
}
getWordMetrics(word, metrics);
writer.addSymbol(metrics.x, metrics.y);
}
writer.newLine(0, font.lineHeight);
}
width = writer.width;
height = writer.height;
nLines = writer.nLines();
}
use of com.watabou.utils.PointF in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Visual method overlapsScreenPoint.
public boolean overlapsScreenPoint(int x, int y) {
Camera c = camera();
if (c == null)
return false;
PointF p = c.screenToCamera(x, y);
return overlapsPoint(p.x, p.y);
}
Aggregations