public PointF screenToCamera( int x, int y ) { return new PointF( (x - this.x) / zoom + scroll.x, (y - this.y) / zoom + scroll.y ); }
public static PointF tileCenterToWorld( int pos ) { return new PointF( (pos % Level.WIDTH + 0.5f) * SIZE, (pos / Level.WIDTH + 0.5f) * SIZE ); }
public PointF worldToCamera( int cell ) { final int csize = DungeonTilemap.SIZE; return new PointF( ((cell % Level.WIDTH) + 0.5f) * csize - width * 0.5f, ((cell / Level.WIDTH) + 1.0f) * csize - height ); }
public PointF worldToCamera( int cell ) { final int csize = DungeonTilemap.SIZE; return new PointF( cell % Level.WIDTH * csize + (csize - SIZE) * 0.5f, cell / Level.WIDTH * csize + (csize - SIZE) * 0.5f ); }
public Camera( int x, int y, int width, int height, float zoom ) { this.x = x; this.y = y; this.width = width; this.height = height; this.zoom = zoom; screenWidth = (int)(width * zoom); screenHeight = (int)(height * zoom); scroll = new PointF(); matrix = new float[16]; Matrix.setIdentity( matrix ); }
public Camera( int x, int y, int width, int height, float zoom ) { this.x = x; this.y = y; this.width = width; this.height = height; this.zoom = zoom; screenWidth = (int)(width * zoom); screenHeight = (int)(height * zoom); scroll = new PointF(); matrix = new float[16]; Matrix.setIdentity( matrix ); }
public static PointF tileCenterToWorld( int pos ) { return new PointF( (pos % Dungeon.level.width() + 0.5f) * SIZE, (pos / Dungeon.level.width() + 0.5f) * SIZE ); }
public static PointF raisedTileCenterToWorld( int pos ) { return new PointF( (pos % Dungeon.level.width() + 0.5f) * SIZE, (pos / Dungeon.level.width() + 0.1f) * SIZE ); }
public PointF worldToCamera( int cell ) { final int csize = DungeonTilemap.SIZE; return new PointF( cell % Dungeon.level.width() * csize + (csize - width()) * 0.5f, cell / Dungeon.level.width() * csize + (csize - height()) - csize * perspectiveRaise ); }
public PointF center( Visual v ) { return new PointF( x + (width() - v.width())/2f, y + (height() - v.height())/2f ); }
public PointF worldToCamera( int cell ) { final int csize = DungeonTilemap.SIZE; return new PointF( PixelScene.align(Camera.main, ((cell % Dungeon.level.width()) + 0.5f) * csize - width * 0.5f), PixelScene.align(Camera.main, ((cell / Dungeon.level.width()) + 1.0f) * csize - height - csize * perspectiveRaise) ); }
public void reset( float x, float y ) { revive(); left = lifespan; super.speed.set( WindParticle.speed ); super.speed.scale( size ); this.x = x - super.speed.x * lifespan / 2; this.y = y - super.speed.y * lifespan / 2; angle += Random.Float( -0.1f, +0.1f ); speed = new PointF().polar( angle, 5 ); am = 0; }
public void reset( float x, float y ) { revive(); left = lifespan; super.speed.set( WindParticle.speed ); super.speed.scale( size ); this.x = x - super.speed.x * lifespan / 2; this.y = y - super.speed.y * lifespan / 2; angle += Random.Float( -0.1f, +0.1f ); speed = new PointF().polar( angle, 5 ); am = 0; }