Search in sources :

Example 56 with PointF

use of com.watabou.utils.PointF in project pixel-dungeon-remix by NYRDS.

the class CustomLayerTilemap method updateVertices.

@Override
protected void updateVertices() {
    super.updateVertices();
    // FIXME
    if (Dungeon.hero == null) {
        return;
    }
    PointF hpos = Dungeon.hero.getHeroSprite().worldCoords();
    float hx = hpos.x;
    float hy = hpos.y;
    Arrays.fill(maskData, 0);
    mask.position(0);
    for (int i = 0; i < level.getHeight(); i++) {
        for (int j = 0; j < level.getWidth(); j++) {
            int p = (i * level.getWidth() + j) * 8;
            maskData[p + 0] = getTCoord(hx, j - 0.5f);
            maskData[p + 1] = getTCoord(hy, i - 0.5f);
            maskData[p + 2] = getTCoord(hx, j + 0.5f);
            maskData[p + 3] = getTCoord(hy, i - 0.5f);
            maskData[p + 4] = getTCoord(hx, j + 0.5f);
            maskData[p + 5] = getTCoord(hy, i + 0.5f);
            maskData[p + 6] = getTCoord(hx, j - 0.5f);
            maskData[p + 7] = getTCoord(hy, i + 0.5f);
        }
    }
    mask.put(maskData);
}
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