示例#1
0
        public MessageBox()
            : base()
        {

            int midX = (FlxG.width / 2) - (320 / 2);
            int midY = 10;

            box = new UIBox(midX, midY, 320, 180);
            box.setScrollFactors(0, 0);
            add(box);

            textBox = new FlxText(midX+10, 20, 320, "");
            textBox.setFormat(null, 2, Color.White, FlxJustification.Left, Color.Black);
            textBox.setScrollFactors(0, 0);
            add(textBox);

            visible = false;

        }
示例#2
0
        public BattleUI()
            : base()
        {

            int midX = (FlxG.width / 2) - (320 / 2);
            int midY = 10;

            box = new UIBox(midX, midY, 320, 180);
            box.setScrollFactors(0, 0);
            add(box);

            FlxText t = new FlxText(midX, midY, 320, "BATTLE");
            t.setScrollFactors(0, 0);
            add(t);

            visible = false;
            
            keys = new KeyGroup();
            add(keys);

#if DEBUGX2
            playerTweener = new Tweener(0, box.x + 50, 1.0f, Circular.EaseOut);
            playerTweener.Start();

            targetTweener = new Tweener(FlxG.width, box.x + box.width - 50, 0.9f, Circular.EaseOut);
            targetTweener.Start();
#else
            playerTweener = new Tweener(0, box.x - 50, 1.0f, Circular.EaseOut);
            playerTweener.Start();

            targetTweener = new Tweener(FlxG.width, box.x + box.width + 50, 0.9f, Circular.EaseOut);
            targetTweener.Start();
#endif



            directions = new int[] { FlxHud.Keyboard_Arrow_Down, FlxHud.Keyboard_Arrow_Up, FlxHud.Keyboard_Arrow_Left, FlxHud.Keyboard_Arrow_Right};

        }