public void layoutTabs(){ //subract two as there's extra horizontal space for those nobs on the top. int fullWidth = width+chrome.marginHor()-2; int numTabs = tabs.size(); if (numTabs == 0) return; if (numTabs == 1) { tabs.get(0).setSize(fullWidth, tabHeight()); return; } int spaces = numTabs-1; int spacing = -1; while (spacing == -1) { for (int i = 0; i <= 3; i++){ if ((fullWidth - i*(spaces)) % numTabs == 0) { spacing = i; break; } } if (spacing == -1) fullWidth--; } int tabWidth = (fullWidth - spacing*(numTabs-1)) / numTabs; for (int i = 0; i < tabs.size(); i++){ tabs.get(i).setSize(tabWidth, tabHeight()); tabs.get(i).setPos( i == 0 ? -chrome.marginLeft() + 1 : tabs.get( i - 1 ).right() + spacing, height ); } }
public void layoutTabs(){ //subract two as there's extra horizontal space for those nobs on the top. int fullWidth = width+chrome.marginHor()-2; int numTabs = tabs.size(); if (numTabs == 0) return; if (numTabs == 1) { tabs.get(0).setSize(fullWidth, tabHeight()); return; } int spaces = numTabs-1; int spacing = -1; while (spacing == -1) { for (int i = 0; i <= 3; i++){ if ((fullWidth - i*(spaces)) % numTabs == 0) { spacing = i; break; } } if (spacing == -1) fullWidth--; } int tabWidth = (fullWidth - spacing*(numTabs-1)) / numTabs; for (int i = 0; i < tabs.size(); i++){ tabs.get(i).setSize(tabWidth, tabHeight()); tabs.get(i).setPos( i == 0 ? -chrome.marginLeft() + 1 : tabs.get( i - 1 ).right() + spacing, height ); } }
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; }
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; }
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; }
public void resize( int w, int h ) { this.width = w; this.height = h; chrome.size( width + chrome.marginHor(), height + chrome.marginVer() ); camera.resize( (int)chrome.width, (int)chrome.height ); camera.x = (int)(Game.width - camera.screenWidth()) / 2; camera.y = (int)(Game.height - camera.screenHeight()) / 2; camera.y += yOffset * camera.zoom; shadow.boxRect( camera.x / camera.zoom, camera.y / camera.zoom, chrome.width(), chrome.height ); }
public void resize( int w, int h ) { this.width = w; this.height = h; chrome.size( width + chrome.marginHor(), height + chrome.marginVer() ); camera.resize( (int)chrome.width, (int)chrome.height ); camera.x = (int)(Game.width - camera.screenWidth()) / 2; camera.y = (int)(Game.height - camera.screenHeight()) / 2; shadow.boxRect( camera.x / camera.zoom, camera.y / camera.zoom, chrome.width(), chrome.height ); }
public void resize( int w, int h ) { this.width = w; this.height = h; chrome.size( width + chrome.marginHor(), height + chrome.marginVer() ); camera.resize( (int)chrome.width, (int)chrome.height ); camera.x = (int)(Game.width - camera.screenWidth()) / 2; camera.y = (int)(Game.height - camera.screenHeight()) / 2; camera.y += yOffset * camera.zoom; shadow.boxRect( camera.x / camera.zoom, camera.y / camera.zoom, chrome.width(), chrome.height ); }
width + chrome.marginHor(), height + chrome.marginVer() );
width + chrome.marginHor(), height + chrome.marginVer() );
width + chrome.marginHor(), height + chrome.marginVer() );
@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(); bg.x = x; bg.y = y; bg.size( width, height ); close.setPos( bg.x + bg.width() - bg.marginHor() / 2f - MARGIN_HOR - close.width(), y + (height - close.height()) / 2f ); PixelScene.align(close); text.setPos(close.left() - MARGIN_HOR - text.width(), y + (height - text.height()) / 2); PixelScene.align(text); }
@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() { super.layout(); bg.x = x; bg.y = y; bg.size( width, height ); close.setPos( bg.x + bg.width() - bg.marginHor() / 2f - MARGIN_HOR - close.width(), y + (height - close.height()) / 2f ); PixelScene.align(close); text.setPos(close.left() - MARGIN_HOR - text.width(), y + (height - text.height()) / 2); PixelScene.align(text); }