Exemplo n.º 1
0
        private void constructor()
        {
            Logics          = new Logics.SegmentDisplay4Logics();
            Graphics        = new Graphics.SegmentDisplay4Graphics();
            Graphics.parent = this;
            Logics.parent   = this;

            Graphics.Size = new Vector2(64, 32);
        }
Exemplo n.º 2
0
        public override void Draw(MicroWorld.Graphics.Renderer renderer)
        {
            if (texture == null)
            {
                return;
            }
            if (!CanDraw())
            {
                return;
            }
            Components.old.SegmentDisplay4 p = (Components.old.SegmentDisplay4)parent;
            Logics.SegmentDisplay4Logics   l = p.Logics as Logics.SegmentDisplay4Logics;

            if (!wasAOEDrawn && AOEOpacity > 0 && !MicroWorld.Graphics.GraphicsEngine.IsSelectedGlowPass)
            {
                DrawAOE(renderer, 1f);
                wasAOEDrawn = false;
            }

            renderer.Draw(texture, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y),
                          new Rectangle(0, 0, (int)Size.X * 4, (int)Size.Y * 4), Color.White);
            //curnumbers
            for (int j = 0; j < 4; j++)
            {
                for (int i = 0; i < 8; i++)
                {
                    if ((l.digits[j] & (1 << i)) != 0)
                    {
                        renderer.Draw(mask,
                                      new Rectangle((int)Position.X + DigitsPositions[j], (int)Position.Y + 7, (int)DigitSize.X, (int)DigitSize.Y),
                                      new Rectangle(i * 44, 0, (int)DigitSize.X * 4, (int)DigitSize.Y * 4),
                                      DisplayColor * ((float)p.W[i * 4 + j].VoltageDropAbs / 5f));
                    }
                }
            }
            //last
            for (int c = 0; c < l.digitsold.Length; c++)
            {
                if (l.digitsold[c] == null)
                {
                    break;
                }
                for (int j = 0; j < 4; j++)
                {
                    for (int i = 0; i < 8; i++)
                    {
                        if ((l.digitsold[c][j] & (1 << i)) != 0)
                        {
                            renderer.Draw(mask,
                                          new Rectangle((int)Position.X + DigitsPositions[j], (int)Position.Y + 7, (int)DigitSize.X, (int)DigitSize.Y),
                                          new Rectangle(i * 44, 0, (int)DigitSize.X * 4, (int)DigitSize.Y * 4),
                                          DisplayColor * 0.1f);
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void constructor()
        {
            Logics = new Logics.SegmentDisplay4Logics();
            Graphics = new Graphics.SegmentDisplay4Graphics();
            Graphics.parent = this;
            Logics.parent = this;

            Graphics.Size = new Vector2(64, 32);
        }