public void reset( Item item, int cell, float endX, float endY ) { view( item ); active = visible = true; PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell); Point screen = Camera.main.cameraToScreen(tile.x, tile.y); PointF start = camera().screenToCamera(screen.x, screen.y); x = this.startX = start.x - ItemSprite.SIZE / 2; y = this.startY = start.y - ItemSprite.SIZE / 2; this.endX = endX - ItemSprite.SIZE / 2; this.endY = endY - ItemSprite.SIZE / 2; left = DURATION; scale.set( startScale = Camera.main.zoom / camera().zoom ); }
public void reset( Item item, int cell, float endX, float endY ) { view( item ); active = visible = true; PointF tile = DungeonTerrainTilemap.raisedTileCenterToWorld(cell); Point screen = Camera.main.cameraToScreen(tile.x, tile.y); PointF start = camera().screenToCamera(screen.x, screen.y); x = this.startX = start.x - ItemSprite.SIZE / 2; y = this.startY = start.y - ItemSprite.SIZE / 2; this.endX = endX - ItemSprite.SIZE / 2; this.endY = endY - ItemSprite.SIZE / 2; left = DURATION; scale.set( startScale = Camera.main.zoom / camera().zoom ); }
@Override protected void layout() { content.setPos( 0, 0 ); controller.x = x; controller.y = y; controller.width = width; controller.height = height; Point p = camera().cameraToScreen( x, y ); Camera cs = content.camera; cs.x = p.x; cs.y = p.y; cs.resize( (int)width, (int)height ); thumb.visible = height < content.height(); if (thumb.visible) { thumb.scale.set( 2, height * height / content.height() ); thumb.x = right() - thumb.width(); thumb.y = y; } }
@Override protected void layout() { content.setPos( 0, 0 ); controller.x = x; controller.y = y; controller.width = width; controller.height = height; Point p = camera().cameraToScreen( x, y ); Camera cs = content.camera; cs.x = p.x; cs.y = p.y; cs.resize( (int)width, (int)height ); indicator.visible = height < content.height(); if (indicator.visible) { indicator.scale.set( 2, height * height / content.height() ); indicator.x = right() - indicator.width(); indicator.y = y; } }
@Override protected void layout() { content.setPos( 0, 0 ); controller.x = x; controller.y = y; controller.width = width; controller.height = height; Point p = camera().cameraToScreen( x, y ); Camera cs = content.camera; cs.x = p.x; cs.y = p.y; cs.resize( (int)width, (int)height ); thumb.visible = height < content.height(); if (thumb.visible) { thumb.scale.set( 2, height * height / content.height() ); thumb.x = right() - thumb.width(); thumb.y = y; } }
final int inputTop = (int)(camera.cameraToScreen(0, txtTitle.bottom() + MARGIN).y * (Game.dispWidth / (float)Game.width));
float vy = align((h - SKY_HEIGHT - BUTTON_HEIGHT) / 2f); Point s = Camera.main.cameraToScreen( vx, vy ); viewport = new Camera( s.x, s.y, SKY_WIDTH, SKY_HEIGHT, defaultZoom ); Camera.add( viewport );
float vy = align((h - SKY_HEIGHT - BUTTON_HEIGHT) / 2f); Point s = Camera.main.cameraToScreen( vx, vy ); viewport = new Camera( s.x, s.y, SKY_WIDTH, SKY_HEIGHT, defaultZoom ); Camera.add( viewport );
float vy = align( (h - SKY_HEIGHT - BUTTON_HEIGHT) / 2 ); Point s = Camera.main.cameraToScreen( vx, vy ); viewport = new Camera( s.x, s.y, SKY_WIDTH, SKY_HEIGHT, defaultZoom ); Camera.add( viewport );