Paint.SpeedGaugeDefinition.SpeedGaugeDefinition C# (CSharp) Method

SpeedGaugeDefinition() public method

Initializes a new instance of the Paint.SpeedGaugeDefinition class.
public SpeedGaugeDefinition ( ToolboxLayoutDefinitionPlaybackToolsSpeedGauge speedGaugeDefinition, int scale ) : Microsoft.Xna.Framework
speedGaugeDefinition Paint.ToolboxLayout.ToolboxLayoutDefinitionPlaybackToolsSpeedGauge Layout of the speed gauge as defined within a xml file.
scale int
return Microsoft.Xna.Framework
        public SpeedGaugeDefinition(ToolboxLayoutDefinitionPlaybackToolsSpeedGauge speedGaugeDefinition, int scale)
        {
            this.Bounds = new Rectangle(
                (int)speedGaugeDefinition.Region.Location.X * scale,
                (int)speedGaugeDefinition.Region.Location.Y * scale,
                speedGaugeDefinition.Region.Size.Width * scale,
                speedGaugeDefinition.Region.Size.Height * scale);

            this.BackgroundColor = new Color(
                speedGaugeDefinition.Region.BackgroundColor.Red,
                speedGaugeDefinition.Region.BackgroundColor.Green,
                speedGaugeDefinition.Region.BackgroundColor.Blue);

            this.BorderColor = new Color(
                speedGaugeDefinition.Region.Border.Color.Red,
                speedGaugeDefinition.Region.Border.Color.Green,
                speedGaugeDefinition.Region.Border.Color.Blue);

            this.BorderWidth = speedGaugeDefinition.Region.Border.Width * scale;

            this.GaugeWidth = speedGaugeDefinition.Gauge.Width * scale;
            this.GaugeMarkerWidth = speedGaugeDefinition.Gauge.MarkerWidth * scale;
            this.GaugeHorizontalMargin = speedGaugeDefinition.Gauge.HorizontalMargin * scale;
            this.GaugeVerticalMargin = speedGaugeDefinition.Gauge.VerticalMargin * scale;
        }
SpeedGaugeDefinition