@Override protected void layout() { tf.x = x + (width - tf.width()) / 2; tf.y = bottom() - tf.height(); }
@Override protected void layout() { tf.x = x + (width - tf.width()) / 2; tf.y = bottom() - tf.height(); }
@Override protected void layout() { tf.x = x + (width - tf.width()) / 2; tf.y = bottom() - tf.height(); }
@Override protected void layout() { super.layout(); icon.x = x + (width - icon.width) / 2; icon.y = y + (height - icon.height) / 2; if (topLeft != null) { topLeft.x = x; topLeft.y = y; } if (topRight != null) { topRight.x = x + (width - topRight.width()); topRight.y = y; } if (bottomRight != null) { bottomRight.x = x + (width - bottomRight.width()); bottomRight.y = y + (height - bottomRight.height()); } if (bottomLeft != null) { bottomLeft.x = x; bottomLeft.y = y + (height - bottomLeft.height()); } }
@Override protected void layout() { super.layout(); if (secondary.text().length() > 0) { text.y = align( y + (height - text.height() - secondary.baseLine()) / 2 ); secondary.x = align( x + (width - secondary.width()) / 2 ); secondary.y = align( text.y + text.height() ); } else { text.y = align( y + (height - text.baseLine()) / 2 ); } }
public Toast( String text ) { super(); text( text ); width = this.text.width() + close.width() + bg.marginHor() + MARGIN_HOR * 3; height = Math.max( this.text.height(), close.height() ) + bg.marginVer() + MARGIN_VER * 2; }
@Override protected void layout() { icon.x = width - icon.width; depth.x = icon.x - 1 - depth.width(); depth.y = PixelScene.align( y + (height - depth.height()) / 2 ); icon.y = depth.y - 1; feature.y = PixelScene.align( depth.y + depth.baseLine() - feature.baseLine() ); } }
public WndChangelog() { super(); if (YetAnotherPixelDungeon.landscape()) { resize( WIDTH_L, HEIGHT_L ); } else { resize( WIDTH_P, HEIGHT_P ); } txtTitle = PixelScene.createText( TXT_TITLE, 9 ); txtTitle.hardlight( Window.TITLE_COLOR ); txtTitle.measure(); txtTitle.x = PixelScene.align( PixelScene.uiCamera, (width - txtTitle.width() ) / 2 ); add( txtTitle ); list = new ScrollPane( new ChangelogItem( TXT_DESCR, width, txtTitle.height() ) ); add( list ); list.setRect( 0, txtTitle.height(), width, height - txtTitle.height() ); list.scrollTo( 0, 0 ); }
@Override protected void layout() { image.x = 0; image.y = Math.max( 0, name.height() + GAP + health.height() - image.height ); name.x = image.width + GAP; name.y = image.height - health.height() - GAP - name.baseLine(); float w = width - image.width - GAP; health.setRect( image.width + GAP, image.height - health.height(), w, health.height() ); buffs.setPos( name.x + name.width() + GAP, name.y + name.baseLine() - BuffIndicator.SIZE ); height = health.bottom(); } }
@Override protected void layout() { super.layout(); shield.x = x; shield.y = y + (height - shield.height) / 2; position.x = align( shield.x + (shield.width - position.width()) / 2 ); position.y = align( shield.y + (shield.height - position.height()) / 2 + 1 ); if (flare != null) { flare.point( shield.center() ); } floorIcon.x = align( x + width - floorIcon.width * 2 ); floorIcon.y = shield.y; flNumber.x = align( floorIcon.x + (floorIcon.width - flNumber.width()) / 2 ); flNumber.y = align( floorIcon.y + (floorIcon.height - flNumber.height()) / 2 + 1 ); classIcon.x = align( x + width - classIcon.width ); classIcon.y = shield.y; chLevel.x = align( classIcon.x + (classIcon.width - chLevel.width()) / 2 ); chLevel.y = align( classIcon.y + (classIcon.height - chLevel.height()) / 2 + 1 ); desc.x = shield.x + shield.width + GAP; desc.maxWidth = (int)(floorIcon.x - desc.x); desc.measure(); desc.y = position.y + position.baseLine() - desc.baseLine(); }
title.measure(); title.x = PixelScene.align( camera, (WIDTH - title.width()) / 2 ); title.y = PixelScene.align( camera, (TTL_HEIGHT - title.height()) / 2 ); add( title );
@Override protected void layout() { super.layout(); bg.x = x; bg.y = y; bg.size( width, height ); close.setPos( bg.x + bg.width() - bg.marginHor() / 2 - MARGIN_HOR - close.width(), y + (height - close.height()) / 2 ); text.x = close.left() - MARGIN_HOR - text.width(); text.y = y + (height - text.height()) / 2; PixelScene.align( text ); }
@Override protected void layout() { super.layout(); avatar.x = align( x + (width - avatar.width()) / 2 ); avatar.y = align( y + (height - avatar.height() - name.height()) / 2 ); name.x = align( x + (width - name.width()) / 2 ); name.y = avatar.y + avatar.height() + SCALE; emitter.pos( avatar.x, avatar.y, avatar.width(), avatar.height() ); }
@Override protected void layout() { panel.x = this.x; panel.y = this.y; panel.alpha(alpha); panel.visible = updateAvailable || !quiet; updateMessage.x = panel.x+panel.marginLeft(); updateMessage.y = panel.y+panel.marginTop(); updateMessage.measure(); updateMessage.alpha(alpha); updateMessage.visible = updateAvailable || !quiet; panel.size( panel.marginHor()+updateMessage.width(), panel.marginVer()+updateMessage.height()-1); this.width = panel.width(); this.height = panel.height(); }
@Override protected void layout() { icon.y = y + 1 + (height() - 1 - icon.height()) / 2f; PixelScene.align(icon); depth.x = icon.x + (icon.width - depth.width()) / 2f; depth.y = icon.y + (icon.height - depth.height()) / 2f + 1; PixelScene.align(depth); line.size(width, 1); line.x = 0; line.y = y; label.maxWidth((int)(width - icon.width() - 8 - 1)); label.setPos(icon.x + icon.width() + 1, y + 1 + (height() - label.height()) / 2f); PixelScene.align(label); } }
@Override protected void layout() { icon.y = y + 1 + (height() - 1 - icon.height()) / 2f; PixelScene.align(icon); depth.x = icon.x + (icon.width - depth.width()) / 2f; depth.y = icon.y + (icon.height - depth.height()) / 2f + 1; PixelScene.align(depth); line.size(width, 1); line.x = 0; line.y = y; label.maxWidth((int)(width - icon.width() - 8 - 1)); label.setPos(icon.x + icon.width() + 1, y + 1 + (height() - label.height()) / 2f); PixelScene.align(label); } }
@Override protected void layout() { icon.y = y + 1 + (height() - 1 - icon.height()) / 2f; PixelScene.align(icon); depth.x = icon.x + (icon.width - depth.width()) / 2f; depth.y = icon.y + (icon.height - depth.height()) / 2f + 1; PixelScene.align(depth); line.size(width, 1); line.x = 0; line.y = y; label.maxWidth((int)(width - icon.width() - 8 - 1)); label.setPos(icon.x + icon.width() + 1, y + 1 + (height() - label.height()) / 2f); PixelScene.align(label); } }
@Override protected void layout() { icon.y = y + 1 + (height() - 1 - icon.height()) / 2f; PixelScene.align(icon); depth.x = icon.x + (icon.width - depth.width()) / 2f; depth.y = icon.y + (icon.height - depth.height()) / 2f + 1; PixelScene.align(depth); line.size(width, 1); line.x = 0; line.y = y; label.maxWidth((int)(width - icon.width() - 8 - 1)); label.setPos(icon.x + icon.width() + 1, y + 1 + (height() - label.height()) / 2f); PixelScene.align(label); } }
add( line ); pos += line.height();