Search in sources :

Example 51 with PointF

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

Example 52 with PointF

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

Example 53 with PointF

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

Example 54 with PointF

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

Example 55 with PointF

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;
}
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