Search in sources :

Example 31 with PointF

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;
        }
    }
}
Also used : PointF(com.watabou.utils.PointF)

Example 32 with PointF

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();
}
Also used : PointF(com.watabou.utils.PointF)

Example 33 with PointF

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;
        }
    });
}
Also used : ScaleTweener(com.watabou.noosa.tweeners.ScaleTweener) PointF(com.watabou.utils.PointF)

Example 34 with PointF

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();
}
Also used : PointF(com.watabou.utils.PointF)

Example 35 with PointF

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);
}
Also used : PointF(com.watabou.utils.PointF)

Aggregations

PointF (com.watabou.utils.PointF)56 Emitter (com.watabou.noosa.particles.Emitter)9 ScaleTweener (com.watabou.noosa.tweeners.ScaleTweener)5 Point (com.watabou.utils.Point)5 RectF (android.graphics.RectF)3 PosTweener (com.watabou.noosa.tweeners.PosTweener)3 ArrayList (java.util.ArrayList)2 Char (com.shatteredpixel.shatteredpixeldungeon.actors.Char)1 Lightning (com.shatteredpixel.shatteredpixeldungeon.effects.Lightning)1 Heap (com.shatteredpixel.shatteredpixeldungeon.items.Heap)1 Crossbow (com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Crossbow)1 Dart (com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart)1 Room (com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room)1 ConnectionRoom (com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection.ConnectionRoom)1 CharSprite (com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite)1 NoosaInputProcessor (com.watabou.input.NoosaInputProcessor)1 ColorBlock (com.watabou.noosa.ColorBlock)1 Image (com.watabou.noosa.Image)1 TextureFilm (com.watabou.noosa.TextureFilm)1 TouchArea (com.watabou.noosa.TouchArea)1