Ejemplo n.º 1
0
        private MySpriteDrawFrame prepareScreen(IMyTextPanel scr)
        {
            scr.ContentType = ContentType.SCRIPT;
            MySpriteDrawFrame frame = scr.DrawFrame();

            frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: screenSize, color: Color.Black));
            return(frame);
        }
Ejemplo n.º 2
0
        private void UpdateLCD(IMyTextPanel surface)
        {
            RectangleF viewport = new RectangleF(
                (surface.TextureSize - surface.SurfaceSize) / 2,
                surface.SurfaceSize
                );
            MySpriteDrawFrame frame = surface.DrawFrame();

            DrawSprites(ref frame, viewport, surface);
            frame.Dispose();
        }
Ejemplo n.º 3
0
            private void setScreenContent(IMyTextPanel scr, float f)
            {
                scr.ContentType = ContentType.SCRIPT;
                MySpriteDrawFrame frame = scr.DrawFrame();

                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: screenSize, color: BLACK));
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSize1, color: GRAY1));
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSize2, color: GRAY2));

                drawBox(frame, f, BLUE_COLOR, 1);
                drawBox(frame, f, GREEN_COLOR, BLUE_THRESH);
                drawBox(frame, f, YELLOW_COLOR, GREEN_THRESH);
                drawBox(frame, f, ORANGE_COLOR, YELLOW_THRESH);
                drawBox(frame, f, RED_COLOR, ORANGE_THRESH);
                drawBox(frame, f, DARKRED_COLOR, RED_THRESH);

                frame.Add(MySprite.CreateText(String.Format("{0:0.000}", (f * 100)) + "%", "monospace", WHITE, 3));

                frame.Dispose();
            }
Ejemplo n.º 4
0
            private void Initialize()
            {
                // Set the sprite display mode
                surfaceProvider.ContentType = ContentType.SCRIPT;
                // Make sure no built-in script has been selected
                surfaceProvider.Script = "";
                // Calculate the viewport by centering the surface size onto the texture size
                this.viewport = new RectangleF((surfaceProvider.TextureSize - surfaceProvider.SurfaceSize) / 2f, surfaceProvider.SurfaceSize);
                // Retrieve the Large Display, which is the first surface
                this.frame = surfaceProvider.DrawFrame();

                Symbol.Add("Cobalt", "Co");
                Symbol.Add("Nickel", "Ni");
                Symbol.Add("Magnesium", "Mg");
                Symbol.Add("Platinum", "Pt");
                Symbol.Add("Iron", "Fe");
                Symbol.Add("Gold", "Au");
                Symbol.Add("Silicon", "Si");
                Symbol.Add("Silver", "Ag");
                Symbol.Add("Stone", "Stone");
                Symbol.Add("Uranium", "U");
                Symbol.Add("Ice", "Ice");
            }
Ejemplo n.º 5
0
        private MySpriteDrawFrame prepareScreen(IMyTextPanel scr)
        {
            scr.ContentType = ContentType.SCRIPT;
            MySpriteDrawFrame frame = scr.DrawFrame();

            frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: screenSize, color: BLACK));

            float x = edgePadding;

            for (int i = 0; i < systems.Count; i++)
            {
                Vector2 pos = new Vector2(x + barSizeBorder.X / 2, 256);
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSizeBorder, color: GRAY1, position: pos));
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSizeBar, color: GRAY2, position: pos));
                x += barGap + barSizeBorder.X;

                pos = new Vector2(x + barSizeBorder.X / 2, 256);
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSizeBorder, color: GRAY1, position: pos));
                frame.Add(new MySprite(SpriteType.TEXTURE, "SquareSimple", size: barSizeBar, color: GRAY2, position: pos));
                x += groupGap + barSizeBorder.X;
            }
            return(frame);
        }