Exemple #1
0
        public DragableMatrixV2(Vector2 size, int maxSlots)
        {
            // make sure valid w/h for number of max slots
            if (size.X * size.Y < maxSlots)
            {
                throw new Exception("More max slots then allowed by size of control!");
            }

            this.Size = size;

            containers    = new List <DragableContainer>();
            this.maxSlots = maxSlots;

            // setup containers relative to loc.

            // if this controls list doesnt have the context menu, add it once!
            contextMenu = new ItemStatsUI(new Vector2(150, 150))
            {
                IsDrawn = false
            };

            SetupContainers();

            mouseOrigin            = new Vector2(-1, -1);
            currentDragableControl = null;
        }
        /// <summary>
        /// MUST BE SQUARE IN SIZE!
        /// </summary>
        public WeaponWheelUIV2(float sideLength)
        {
            this.sideLength = sideLength;
            this.Size = new Vector2(sideLength, sideLength);
            this.Border = new BorderInfo(Sprites.guiSpritesDictionary["weapon_wheel_border"]);
            this.Alignment = ControlAlignment.Center;

            // Weapon stats container
            weaponStatsContainer = new ItemStatsUI(this.Size * .4f);
            weaponStatsContainer.Border = new BorderInfo(Sprites.guiSpritesDictionary["weapon_wheel_border"]);
            weaponStatsContainer.Controls[1].Border = null;
            weaponStatsContainer.Alignment = ControlAlignment.Center;
            Add(weaponStatsContainer);

            //KeyClicked += WeaponWheelUIV2_KeyClicked;
        }
        /// <summary>
        /// MUST BE SQUARE IN SIZE!
        /// </summary>
        public WeaponWheelUIV2(float sideLength)
        {
            this.sideLength = sideLength;
            this.Size       = new Vector2(sideLength, sideLength);
            this.Border     = new BorderInfo(Sprites.guiSpritesDictionary["weapon_wheel_border"]);
            this.Alignment  = ControlAlignment.Center;

            // Weapon stats container
            weaponStatsContainer                    = new ItemStatsUI(this.Size * .4f);
            weaponStatsContainer.Border             = new BorderInfo(Sprites.guiSpritesDictionary["weapon_wheel_border"]);
            weaponStatsContainer.Controls[1].Border = null;
            weaponStatsContainer.Alignment          = ControlAlignment.Center;
            Add(weaponStatsContainer);

            //KeyClicked += WeaponWheelUIV2_KeyClicked;
        }