Example #1
0
        public void YogUI_LoadContentTest()
        {
            Game game = null; // TODO: Initialize to an appropriate value

            YogUI.YogUI_LoadContent(game);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            YogUI.YogUI_LoadContent(this);

            SpriteFont buttonFont = Content.Load <SpriteFont>("buttonFont");

            loadNinepatch   = new Button(new Vector2(46, 23), "Open", buttonFont, loadExisting);
            saveNinepatchAs = new Button(new Vector2(150, 23), "Save", buttonFont, saveImage);

            xStart = new TextField(new Vector2(225, 3), 70, 15, Color.Black, buttonFont, (string s) => { refresh(); }, (string s) => { refresh(); });
            xEnd   = new TextField(new Vector2(225, 28), 70, 15, Color.Black, buttonFont, (string s) => { refresh(); }, (string s) => { refresh(); });
            xStart.stringPattern   = xEnd.stringPattern = "^\\d+?$";
            xStart.placeHolderText = "X start";
            xEnd.placeHolderText   = "X end";

            yStart = new TextField(new Vector2(305, 3), 70, 15, Color.Black, buttonFont, (string s) => { refresh(); }, (string s) => { refresh(); });
            yEnd   = new TextField(new Vector2(305, 28), 70, 15, Color.Black, buttonFont, (string s) => { refresh(); }, (string s) => { refresh(); });
            yStart.stringPattern   = yEnd.stringPattern = "^\\d+?$";
            yStart.placeHolderText = "Y start";
            yEnd.placeHolderText   = "Y end";

            refreshNinepatch = new Button(new Vector2(420, 18), "Refresh", buttonFont, refresh);

            patchScale = new SliderBar(new Vector2(465, 9), 225, 30, 0, 100, buttonFont);

            drawContent = new CheckBox(new Vector2(390, 45), buttonFont);
            drawContent.SetLabel("Draw content");
            drawContent.SetChecked(true);

            scaleX  = new RadioButton(new Vector2(700, 9), buttonFont, "Scale X");
            scaleY  = new RadioButton(new Vector2(700, 23), buttonFont, "Scale Y");
            scaleXY = new RadioButton(new Vector2(700, 37), buttonFont, "Scale X+Y");

            scaleGroup.addButton(scaleX);
            scaleGroup.addButton(scaleY);
            scaleGroup.addButton(scaleXY);

            scaleX.selected = true;

            // TODO: use this.Content to load your game content here
        }