@Override protected void updateValues( float progress ) { visual.point( PointF.inter( start, end, progress ).offset( 0, -height * 4 * progress * (1 - progress) ) ); } }
@Override protected void updateValues( float progress ) { visual.point( PointF.inter( start, end, progress ).offset( 0, -height * 4 * progress * (1 - progress) ) ); } }
@Override protected void updateValues( float progress ) { visual.point( PointF.inter( start, end, progress ).offset( 0, -height * 4 * progress * (1 - progress) ) ); } }
@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; } } } }
public void drop( int from ) { if (heap.pos == from) { drop(); } else { float px = x; float py = y; drop(); place(from); speed.offset((px - x) / DROP_INTERVAL, (py - y) / DROP_INTERVAL); } }
public void drop( int from ) { if (heap.pos == from) { drop(); } else { float px = x; float py = y; drop(); place( from ); speed.offset( (px-x) / DROP_INTERVAL, (py-y) / DROP_INTERVAL ); } }
public void drop( int from ) { if (heap.pos == from) { drop(); } else { float px = x; float py = y; drop(); place(from); speed.offset((px - x) / DROP_INTERVAL, (py - y) / DROP_INTERVAL); } }
public CheckedCell( int pos ) { super( TextureCache.createSolid( 0xFF55AAFF ) ); origin.set( 0.5f ); point( DungeonTilemap.tileToWorld( pos ).offset( DungeonTilemap.SIZE / 2, DungeonTilemap.SIZE / 2 ) ); alpha = 0.8f; }
public CheckedCell( int pos ) { super( TextureCache.createSolid( 0xFF55AAFF ) ); origin.set( 0.5f ); point( DungeonTilemap.tileToWorld( pos ).offset( DungeonTilemap.SIZE / 2, DungeonTilemap.SIZE / 2 ) ); alpha = 0.8f; }
public CheckedCell( int pos ) { super( TextureCache.createSolid( 0xFF55AAFF ) ); origin.set( 0.5f ); point( DungeonTilemap.tileToWorld( pos ).offset( DungeonTilemap.SIZE / 2, DungeonTilemap.SIZE / 2 ) ); alpha = 0.8f; }
@Override public void update() { super.update(); if (cell < 0 || cell >= Dungeon.level.length()){ visible = false; return; } 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; } } } }
public int screenToTile( int x, int y ) { Point p = camera().screenToCamera( x, y ). offset( this.point().negate() ). invScale( SIZE ). floor(); return p.x >= 0 && p.x < Level.WIDTH && p.y >= 0 && p.y < Level.HEIGHT ? p.x + p.y * Level.WIDTH : -1; }
@Override protected void onItemSelected( Item item ) { curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); item.identify(); GLog.i( Messages.get(this, "it_is", item) ); Badges.validateItemLevelAquired( item ); }
@Override protected void onItemSelected( Item item ) { curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); item.identify(); GLog.i( Messages.get(this, "it_is", item) ); Badges.validateItemLevelAquired( item ); }
@Override protected void onClick() { super.onClick(); useAnimation(); if (item.getClass() == curGuess){ item.identify(); GLog.p( Messages.get(WndGuess.class, "correct") ); curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); } else { GLog.n( Messages.get(WndGuess.class, "incorrect") ); } curGuess = null; hide(); } };
@Override protected void onClick() { super.onClick(); useAnimation(); if (item.getClass() == curGuess){ item.identify(); GLog.p( Messages.get(WndGuess.class, "correct") ); curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); } else { GLog.n( Messages.get(WndGuess.class, "incorrect") ); } curGuess = null; hide(); } };
private void doScroll(PointF current) { final Camera c = content.camera; c.scroll.offset( PointF.diff(lastPos, current).invScale( c.zoom ) ); if (c.scroll.x + width > content.width()) { c.scroll.x = content.width() - width; } if (c.scroll.x < 0) { c.scroll.x = 0; } if (c.scroll.y + height > content.height()) { c.scroll.y = content.height() - height; } if (c.scroll.y < 0) { c.scroll.y = 0; } thumb.y = y + height * c.scroll.y / content.height(); lastPos.set(current); } }
@Override protected void onDrag( Touch t ) { camera.target = null; if (pinching) { float curSpan = PointF.distance( touch.current, another.current ); camera.zoom( GameMath.gate( PixelScene.minZoom, startZoom * curSpan / startSpan, PixelScene.maxZoom ) ); } else { if (!dragging && PointF.distance( t.current, t.start ) > dragThreshold) { dragging = true; lastPos.set( t.current ); } else if (dragging) { camera.scroll.offset( PointF.diff( lastPos, t.current ).invScale( camera.zoom ) ); lastPos.set( t.current ); } } }
public int screenToTile(int x, int y, boolean wallAssist ) { PointF p = camera().screenToCamera( x, y ). offset( this.point().negate() ). invScale( SIZE ); //snap to the edges of the tilemap p.x = GameMath.gate(0, p.x, Dungeon.level.width()-0.001f); p.y = GameMath.gate(0, p.y, Dungeon.level.height()-0.001f); int cell = (int)p.x + (int)p.y * Dungeon.level.width(); if (wallAssist && map != null && DungeonTileSheet.wallStitcheable(map[cell])){ if (cell + mapWidth < size && p.y % 1 >= 0.75f && !DungeonTileSheet.wallStitcheable(map[cell + mapWidth])){ cell += mapWidth; } } return cell; }
public int screenToTile(int x, int y, boolean wallAssist ) { PointF p = camera().screenToCamera( x, y ). offset( this.point().negate() ). invScale( SIZE ); //snap to the edges of the tilemap p.x = GameMath.gate(0, p.x, Dungeon.level.width()-0.001f); p.y = GameMath.gate(0, p.y, Dungeon.level.height()-0.001f); int cell = (int)p.x + (int)p.y * Dungeon.level.width(); if (wallAssist && map != null && DungeonTileSheet.wallStitcheable(map[cell])){ if (cell + mapWidth < size && p.y % 1 >= 0.75f && !DungeonTileSheet.wallStitcheable(map[cell + mapWidth])){ cell += mapWidth; } } return cell; }