Example #1
0
            public HorizontalGauge(int id, Texture2D skin, Texture2D primaryScale, Texture2D secondaryScale = null)
                : base(id)
            {
                this.primaryScale   = primaryScale;
                this.secondaryScale = secondaryScale;
                this.skin           = skin;
                this.skinBounds     = new Rect(0, 0, NanoGauges.configuration.verticalGaugeWidth, NanoGauges.configuration.verticalGaugeHeight);
                this.scaleBounds    = new Rect(0, 0, SCALE_WIDTH, SCALE_HEIGHT);
                //
                this.off.y      = 0;
                this.off.height = 1.0f;


                if (primaryScale == null)
                {
                    Log.Error("no scale for gauge " + id + " defined");
                }
                if (skin == null)
                {
                    Log.Error("no skin for gauge " + id + " defined");
                }

                offFlag   = new PowerOffFlag(this);
                limitFlag = new LimiterFlag(this);
            }
Example #2
0
            public VerticalGauge(int id, Texture2D skin, Texture2D scale, bool damped = true, float dampfactor = 0.002f)
                : base(id)
            {
                this.damper = new Damper(dampfactor);
                this.damper.SetEnabled(damped);
                this.scale       = scale;
                this.skin        = skin;
                this.skinBounds  = new Rect(0, 0, NanoGauges.configuration.verticalGaugeWidth, NanoGauges.configuration.verticalGaugeHeight);
                this.scaleBounds = new Rect(0, 0, SCALE_WIDTH, SCALE_HEIGHT);
                //
                this.zoom = new VerticalGaugeZoom(this, skin, scale);

                if (scale == null)
                {
                    Log.Error("no scale for gauge " + id + " defined");
                }
                if (skin == null)
                {
                    Log.Error("no skin for gauge " + id + " defined");
                }

                offFlag   = new PowerOffFlag(this);
                limitFlag = new LimiterFlag(this);
            }