v0.3.3: adjusted wndOptions to be wider in landscape
This commit is contained in:
parent
66ee082503
commit
a6db02535f
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.watabou.noosa.BitmapTextMultiline;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
|
@ -27,22 +28,26 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
|||
|
||||
public class WndOptions extends Window {
|
||||
|
||||
private static final int WIDTH = 120;
|
||||
private static final int WIDTH_P = 120;
|
||||
private static final int WIDTH_L = 144;
|
||||
|
||||
private static final int MARGIN = 2;
|
||||
private static final int BUTTON_HEIGHT = 20;
|
||||
|
||||
public WndOptions( String title, String message, String... options ) {
|
||||
super();
|
||||
|
||||
|
||||
int width = ShatteredPixelDungeon.landscape() ? WIDTH_L : WIDTH_P;
|
||||
|
||||
BitmapTextMultiline tfTitle = PixelScene.createMultiline( title, 9 );
|
||||
tfTitle.hardlight( TITLE_COLOR );
|
||||
tfTitle.x = tfTitle.y = MARGIN;
|
||||
tfTitle.maxWidth = WIDTH - MARGIN * 2;
|
||||
tfTitle.maxWidth = width - MARGIN * 2;
|
||||
tfTitle.measure();
|
||||
add( tfTitle );
|
||||
|
||||
BitmapTextMultiline tfMesage = PixelScene.createMultiline( message, 6 );
|
||||
tfMesage.maxWidth = WIDTH - MARGIN * 2;
|
||||
tfMesage.maxWidth = width - MARGIN * 2;
|
||||
tfMesage.measure();
|
||||
tfMesage.x = MARGIN;
|
||||
tfMesage.y = tfTitle.y + tfTitle.height() + MARGIN;
|
||||
|
@ -59,13 +64,13 @@ public class WndOptions extends Window {
|
|||
onSelect( index );
|
||||
}
|
||||
};
|
||||
btn.setRect( MARGIN, pos, WIDTH - MARGIN * 2, BUTTON_HEIGHT );
|
||||
btn.setRect( MARGIN, pos, width - MARGIN * 2, BUTTON_HEIGHT );
|
||||
add( btn );
|
||||
|
||||
pos += BUTTON_HEIGHT + MARGIN;
|
||||
}
|
||||
|
||||
resize( WIDTH, (int)pos );
|
||||
resize( width, (int)pos );
|
||||
}
|
||||
|
||||
protected void onSelect( int index ) {};
|
||||
|
|
Loading…
Reference in New Issue
Block a user