コード例 #1
0
        private UIDrawing()
        {
            Tiles = new ItemsHolder(new RectangleF(80 * 7 + 64, 640 + 121, 1024 + 128 - 16, 128 + 64), 14, 40);
            _transaprencyForeground = new Graber(new Vector2(512 - 96, 128 + 128), 255, null, TransparencyForeground, GrabShow.percentage, "Foreground transparency");
            _transaprencyBackground = new Graber(new Vector2(512 - 96, 128 + 64), 255, null, TransparencyBackground, GrabShow.percentage, "Background transparency");
            _transaprencyPhysics    = new Graber(new Vector2(512 - 96, 128 + 64 + 128), 255, null, null, GrabShow.percentage, "Physics transparency");
            _radio1 = new Radio(null, new Vector2(1024 - 64 - 96, 128 + 64), RadioType.classic);
            _radio2 = new Radio(null, new Vector2(1024 - 64 - 96, 256), RadioType.classic);
            _radio3 = new Radio(null, new Vector2(1024 - 64 - 96, 256 + 64), RadioType.classic);
            _radios = new GroupRadios(0, _radio1, _radio2, _radio3);
            ForegroundVisibility = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 128), CheckBoxType.visibility, true, null, null);
            BackgroundVisibility = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 64), CheckBoxType.visibility, false, null, null);
            PhysicsVisibility    = new CheckBox(null, new Vector2(1024 - 128 - 96, 128 + 64 + 128), CheckBoxType.visibility, false, null, null);
            TilesPhysics         = new ItemsHolder(new RectangleF(80 * 7 + 64, 640 + 121, 1024 + 128 - 16, 128 + 64), 14, 40);

            for (int x = 0; x < Game1.Tiles.Count; x++)
            {
                int y = (int)Math.Floor(x / 14f);
                Tiles.Items.Add(new ListItemTile(Tiles.Items.Count, Tiles.Boundary, Game1.Tiles[x]));
            }

            for (int x = 0; x < Game1.TilesPhysics.Count; x++)
            {
                int y = (int)Math.Floor(x / 14f);
                TilesPhysics.Items.Add(new ListItemTile(TilesPhysics.Items.Count, Tiles.Boundary, Game1.TilesPhysics[x]));
            }

            Tiles.Update();
            TilesPhysics.Update();
        }
コード例 #2
0
ファイル: ColorPicker.cs プロジェクト: BlueBananasaurus/BP
 public ColorPicker(Vector2 position)
 {
     _grabRed   = new Graber(position + new Vector2(64, 40), 0, Game1.Textures["ColorBarRed"], UpdateRedText);
     _grabGreen = new Graber(position + new Vector2(64, 64) + new Vector2(0, 40), 0, Game1.Textures["ColorBarGreen"], UpdateGreenText);
     _grabBlue  = new Graber(position + new Vector2(64, 64) + new Vector2(0, 40 + 64), 0, Game1.Textures["ColorBarBlue"], UpdateBlueText);
     _texRed    = new TextBox(_grabRed.GetValue().ToString(), 64, position + new Vector2(256 + 96, 50), textBoxType.number, UpdateRed, 0, 255);
     _texGreen  = new TextBox(_grabRed.GetValue().ToString(), 64, position + new Vector2(256 + 96, 50 + 64), textBoxType.number, UpdateGreen, 0, 255);
     _texBlue   = new TextBox(_grabRed.GetValue().ToString(), 64, position + new Vector2(256 + 96, 50 + 128), textBoxType.number, UpdateBlue, 0, 255);
     _position  = position;
 }