From 21bfecb69ff3bb0819af914ce61cf6c311f8f868 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 14 Oct 2014 18:04:48 -0400 Subject: [PATCH] V0.2.1b: WIP changes windows --- .../windows/WndChanges.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/windows/WndChanges.java diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndChanges.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndChanges.java new file mode 100644 index 000000000..a0a888714 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndChanges.java @@ -0,0 +1,49 @@ +package com.shatteredpixel.shatteredpixeldungeon.windows; + +import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; +import com.shatteredpixel.shatteredpixeldungeon.ui.ScrollPane; +import com.shatteredpixel.shatteredpixeldungeon.ui.Window; +import com.watabou.noosa.BitmapText; +import com.watabou.noosa.BitmapTextMultiline; +import com.watabou.noosa.ui.Component; + +/** + * Created by debenhame on 14/10/2014. + */ +public class WndChanges extends Window { + + private static final int WIDTH = 112; + private static final int HEIGHT = 160; + + private static final String TXT_TITLE = "Changes"; + + private static final String TXT_CHANGES = "test test test test test test test test test test test test test test test" + + "\n\n test test test test test test test test test test test test test test test\ntest test test test " + + "test test test test test test\n\n\ntest test test test testtest test test test test"; + + private BitmapText txtTitle; + private ScrollPane text; + + public WndChanges() { + super(); + resize( WIDTH, HEIGHT ); + + txtTitle = PixelScene.createText(TXT_TITLE, 9); + txtTitle.hardlight( Window.SHPX_COLOR ); + txtTitle.measure(); + txtTitle.x = PixelScene.align( PixelScene.uiCamera, (WIDTH - txtTitle.width()) / 2 ); + add( txtTitle ); + + BitmapTextMultiline txtChanges = PixelScene.createMultiline(TXT_CHANGES, 9); + + Component content = new Component(); + + content.add(txtChanges); + + text = new ScrollPane( content ) { + + }; + add( text ); + text.setRect( 0, txtTitle.height(), WIDTH, HEIGHT - txtTitle.height() ); + } +}