示例#1
0
        public override void Load(ContentManager content)
        {
            base.Load(content);

            mTree          = new MotherTree();
            mTree.Position = GHelper.Center(Globals.ScreenBox, mTree.Size) + new Vector2(0, -(mTree.Size.Y / 3));
        }
示例#2
0
        public FramesGui()
        {
            Size     = Gui.FramesSize;
            Position = Gui.FramesPos;

            Color = new Color(60, 60, 60);

            selectBox = new Sprite(GameContent.boxbox);
            selectBox.SetColor(Color.CornflowerBlue);
            selectBox.Size = SpriteFrame.frameSize;

            hoverBox = new Sprite(GameContent.box);
            hoverBox.SetColor(new Color(20, 20, 20));
            hoverBox.Size  = SpriteFrame.frameSize;
            hoverBox.Alpha = 25;

            btReset = CreateBt(Position.X + 4, Position.Y + 4 + 24, "Reset");
            btReset.SetColor(new Color(50, 50, 50));

            ibSpeed          = new InputBox(ScreenManager.gd, 80, 24);
            ibSpeed.Position = Position + new Vector2(4) + new Vector2(128, 24);

            lbSpeed          = new Label(GameContent.font, "FrameLength");
            lbSpeed.Position = new Vector2(GHelper.Center(ibSpeed.Rectangle, lbSpeed.TextSize).X, ibSpeed.Position.Y - lbSpeed.TextSize.Y - 2);
        }
示例#3
0
        void AddButtons()
        {
            if (btTexture == null)
            {
                btTexture = Extras.CreateFilledBox(ScreenManager.GraphicsDevice);
            }
            switch (pType)
            {
            case PopupType.Ok:
                btOk          = new Button(ScreenManager.GraphicsDevice, btTexture, 64, 32, "Ok");
                btOk.Position = new Vector2(GHelper.Center(box.Rectangle, btOk.Size).X, box.Rectangle.Bottom - btOk.Size.Y - 4);
                break;

            case PopupType.YesNo:
                btYes          = new Button(ScreenManager.GraphicsDevice, btTexture, 64, 32, "Yes");
                btYes.Position = new Vector2(box.Position.X + 4, box.Rectangle.Bottom - btYes.Size.Y - 4);

                btNo          = new Button(ScreenManager.GraphicsDevice, btTexture, 64, 32, "No");
                btNo.Position = new Vector2(box.Position.X + box.Size.X - btNo.Size.X - 4, box.Rectangle.Bottom - btNo.Size.Y - 4);
                break;

            case PopupType.OkCancel:
                btOk          = new Button(ScreenManager.GraphicsDevice, btTexture, 64, 32, "Ok");
                btOk.Position = new Vector2(box.Position.X + 4, box.Rectangle.Bottom - btOk.Size.Y - 4);

                btCancel          = new Button(ScreenManager.GraphicsDevice, btTexture, 64, 32, "Cancel");
                btCancel.Position = new Vector2(box.Position.X + box.Size.X - btCancel.Size.X - 4, box.Rectangle.Bottom - btCancel.Size.Y - 4);
                break;

            default:
                break;
            }
        }
        public AnimationsListGui()
        {
            Size     = Gui.AnimListSize;
            Position = Gui.AnimListPos;

            Color = new Color(60, 60, 60);

            var textSize = UtilityContent.debugFont.MeasureString("label #");

            AnimationLabel.TextHeight = (int)textSize.Y;

            selectedBox = new Sprite(Extras.CreateHollowBox(ScreenManager.gd, Gui.rightWidth, (int)textSize.Y, 1));
            //selectedBox.Size = new Vector2(Gui.rightWidth, textSize.Y);
            selectedBox.Color = Color.LightSteelBlue;
            selectedBox.Alpha = 100;

            hoverBox       = new Sprite();
            hoverBox.Size  = new Vector2(Gui.rightWidth, textSize.Y);
            hoverBox.Color = new Color(80, 80, 80);
            hoverBox.Alpha = 50;

            btAdd = new Button(ScreenManager.gd, 42, 32, "Add");
            btAdd.SetColor(new Color(50, 50, 50));
            btAdd.Position = new Vector2(GHelper.Center(Rectangle, btAdd.Size).X - 32, Position.Y + 4);

            btDel = new Button(ScreenManager.gd, 42, 32, "Del");
            btDel.SetColor(new Color(50, 50, 50));
            btDel.Position = new Vector2(GHelper.Center(Rectangle, btDel.Size).X + 32, Position.Y + 4);
        }
示例#5
0
        public GameState(GameScreen g)
        {
            game = g;

            lbTitle          = new Label(UtilityContent.debugFont, GetType().Name);
            lbTitle.Scale    = 1.5f;
            lbTitle.Position = new Vector2(GHelper.Center(OboGlobals.ScreenBox, lbTitle.Size * lbTitle.Scale).X, 100);
        }
示例#6
0
 public void Draw(SpriteBatch sb)
 {
     for (int i = 0; i < labels.Count; i++)
     {
         var lb  = labels[i];
         var pos = GHelper.Center(Globals.ScreenBox, lb.TextSize) - new Vector2(0, Globals.ScreenHeight / 5 + (i * lb.TextSize.Y + 1));
         lb.Position = pos;
         lb.Draw(sb);
     }
 }
示例#7
0
        public override void Load()
        {
            base.Load();

            CreateBox();
            AddButtons();

            lbText          = new Label(font, msg);
            lbText.Position = new Vector2(GHelper.Center(box.Rectangle, lbText.TextSize).X, box.Position.Y + 4);
        }
示例#8
0
        void CreateBox()
        {
            box         = new Sprite();
            box.Texture = Extras.CreateFilledBox(ScreenManager.GraphicsDevice);
            box.SetSize(224, 96);
            box.Position = GHelper.Center(Globals.ScreenBox, box.Size) - new Vector2(0, box.Size.Y * .5f);
            box.SetColor(Color);

            outline         = new Sprite();
            outline.Texture = Extras.CreateFilledBox(ScreenManager.GraphicsDevice);
            outline.SetSize((int)box.Size.X + 4, (int)box.Size.Y + 4);
            outline.Position = box.Position - new Vector2(2, 2);
            outline.SetColor(Color.Black);
        }
示例#9
0
        public override void Draw(SpriteBatch sb)
        {
            base.Draw(sb);

            int i = 0;

            foreach (var f in frames)
            {
                var spacing = 8;
                int y       = (int)GHelper.Center(Rectangle, SpriteFrame.frameSize).Y;
                int x       = (int)Position.X + spacing + (i * (int)SpriteFrame.frameSize.X) + (i * 16);
                var pos     = new Vector2(x, y);

                if (!f.IsDragging)
                {
                    f.position = pos;
                    if (f.Rectangle.Contains(Input.MousePos))
                    {
                        hoverBox.Position = f.position;
                        hoverBox.Draw(sb);
                    }
                }

                f.Draw(sb, SelectedSheet);
                f.DrawInfo(sb);

                sb.DrawString(GameContent.font, $"{i + 1}", pos - new Vector2(10), Color.White);

                i++;
            }

            if (frame != null)
            {
                selectBox.Position = frame.position;
                selectBox.Draw(sb);
            }


            btReset.Draw(sb);

            ibSpeed.Draw(sb);
            lbSpeed.Draw(sb);
        }
示例#10
0
        public SaveWindow()
        {
            SetSize(240, 160);
            Position = GHelper.Center(Globals.ScreenBox, Size);

            Color = new Color(25, 25, 25);

            lbName          = new Label(UtilityContent.debugFont, "Filename:");
            lbName.Position = new Vector2(GHelper.Center(Rectangle, lbName.TextSize).X, Position.Y + 15);

            ibName          = new InputBox(ScreenManager.gd, 200, 24);
            ibName.Position = new Vector2(GHelper.Center(Rectangle, ibName.Size).X, Position.Y + 60);
            ibName.Text     = ibDefaultText;

            btOk          = new Button(ScreenManager.gd, 72, 26, "Ok");
            btOk.Position = new Vector2(GHelper.Center(Rectangle, btOk.Size).X - 48, Position.Y + 100);

            btClose          = new Button(ScreenManager.gd, 72, 26, "Close");
            btClose.Position = new Vector2(GHelper.Center(Rectangle, btOk.Size).X + 48, Position.Y + 100);
        }
示例#11
0
        void AddButtons()
        {
            switch (pType)
            {
            case PopupType.Ok:
                btOk          = new Button(ScreenManager.GraphicsDevice, 64, 32, "Ok");
                btOk.Position = new Vector2(GHelper.Center(box.Rectangle, btOk.Size).X, box.Rectangle.Bottom - btOk.Size.Y - 4);
                break;

            case PopupType.YesNo:
                btYes          = new Button(ScreenManager.GraphicsDevice, 64, 32, "Yes");
                btYes.Position = new Vector2(box.Position.X + 4, box.Rectangle.Bottom - btYes.Size.Y - 4);

                btNo          = new Button(ScreenManager.GraphicsDevice, 64, 32, "No");
                btNo.Position = new Vector2(box.Position.X + box.Size.X - btNo.Size.X - 4, box.Rectangle.Bottom - btNo.Size.Y - 4);
                break;

            default:
                break;
            }
        }
示例#12
0
 public void DrawInfo(SpriteBatch sb)
 {
     lbSpeed.Position = new Vector2(GHelper.Center(Rectangle, lbSpeed.TextSize).X, Rectangle.Bottom + 16);
     lbSpeed.Draw(sb);
 }
示例#13
0
        public virtual void Draw(SpriteBatch sb, GameTime gt)
        {
            sb.Begin();

            if (IsPaused)
            {
                Extras.DrawString(sb, UtilityContent.debugFont, "PAUSED", new Vector2(GHelper.Center(Globals.ScreenBox, new Vector2(40, 12)).X, 2));
            }

            sb.End();
        }