Example #1
0
        /// <summary>
        /// Called when graphics resources need to be loaded.
        /// Use this for the usage of :
        /// - creation of the internal embedded controls.
        /// - setting of the variables and resources in this control
        /// - to load any game-specific graphics resources
        /// - take over the config width and height and use it into State
        /// - overriding how this item looks like , by settings its texture or theme
        /// Call base.LoadContent before you do your override code, this will cause :
        /// - State.SourceRectangle to be reset to the Config.Size
        /// </summary>
        public override void LoadContent()
        {
            base.LoadContent();

            // the gradient
            this.colorBoxGradient = new ColorBoxGradient(Name + "-Gradient")
            {
                Config =
                {
                    PositionX = 0,
                    PositionY = 0
                }
            };
            this.AddControl(this.colorBoxGradient);

            // slider vertical
            this.slider = new ColorSliderVertical(Name + "-Slider")
            {
                Config =
                {
                    PositionX = this.colorBoxGradient.Config.Width,
                    PositionY = 0
                }
            };
            this.AddControl(this.slider);

            // the box with the final color
            this.colorBoxSolid = new ColorBoxSolid(Name + "-ColorBox")
            {
                Config =
                {
                    PositionX =                                   0,
                    PositionY = this.colorBoxGradient.Config.Height,
                    Width     = this.colorBoxGradient.Config.Width + this.slider.Config.Width
                }
            };
            this.AddControl(this.colorBoxSolid);
        }
Example #2
0
        /// <summary>
        /// Called when graphics resources need to be loaded.
        /// Use this for the usage of :
        /// - creation of the internal embedded controls.
        /// - setting of the variables and resources in this control
        /// - to load any game-specific graphics resources
        /// - take over the config width and height and use it into State
        /// - overriding how this item looks like , by settings its texture or theme
        /// Call base.LoadContent before you do your override code, this will cause :
        /// - State.SourceRectangle to be reset to the Config.Size
        /// </summary>
        public override void LoadContent()
        {
            base.LoadContent();

            // the gradient
            this.colorBoxGradient = new ColorBoxGradient(Name + "-Gradient")
            {
                Config =
                {
                    PositionX = 0,
                    PositionY = 0
                }
            };
            this.AddControl(this.colorBoxGradient);

            // slider vertical
            this.slider = new ColorSliderVertical(Name + "-Slider")
            {
                Config =
                {
                    PositionX = this.colorBoxGradient.Config.Width,
                    PositionY = 0
                }
            };
            this.AddControl(this.slider);

            // the box with the final color
            this.colorBoxSolid = new ColorBoxSolid(Name + "-ColorBox")
            {
                Config =
                {
                    PositionX = 0,
                    PositionY = this.colorBoxGradient.Config.Height,
                    Width = this.colorBoxGradient.Config.Width + this.slider.Config.Width
                }
            };
            this.AddControl(this.colorBoxSolid);
        }