SetPolygons() public méthode

public SetPolygons ( ) : void
Résultat void
Exemple #1
0
        public DebugConsole()
        {
            ExposedReferences = new Dictionary<string, object>();

            visuals = new DisplayObject();
            AddChild(visuals);

            var background = new ColoredRectangle(0, 0, Firefly.Window.Width, Firefly.Window.Height / 2, 0, 0, 0, 0.85F);
            visuals.AddChild(background);
            var line = new ColoredShape();
            line.OutlinePolygons.AddLast(new Polygon(false,
                4, 0, 1, 1, 1, 1,
                Firefly.Window.Width - 4, 0, 1, 1, 1, 1));
            line.SetPolygons();
            line.Y = Firefly.Window.Height / 2 - 20;
            visuals.AddChild(line);

            input = new TextField(new System.Drawing.Font("Consolas", 10), System.Drawing.Brushes.White, 0x0, Firefly.Window.Width, 20);
            input.Y = Firefly.Window.Height / 2 - 17;
            input.IllegalChars.AppendMany('\r', '\n');
            visuals.AddChild(input);

            consoleText = new Label("", new Font("Consolas", 10), Brushes.White);
            visuals.AddChild(consoleText);

            history = new List<string>();

            CloseConsole();
        }
Exemple #2
0
        static void OnLoad( object Target, EventArgs Arguments )
        {
            Firefly.Window.ClearColor = System.Drawing.Color.Black;

            ColoredShape background = new ColoredShape();
            background.FilledPolygons.AddLast( new Polygon( false,
                0, 0, 0.5F, 0.5F, 0.5F, 1,
                800, 0, 0.5F, 0.5F, 0.5F, 1,
                800, 500, 0.5F, 0.5F, 0.5F, 1,
                0, 500, 0.5F, 0.5F, 0.5F, 1 ) );
            background.SetPolygons();
            //Firefly.RenderList.AddLast( background );

            new Mouse();
        }
Exemple #3
0
        public TextField(Font font, Brush textColor, uint backgroundColor, float width, float height, Rectangle? wordWrap = null)
        {
            layer = new Layer();
            AddChild(layer);
            float a = (backgroundColor & 0xFF) / 255F;
            float b = ((backgroundColor >> 8) & 0xFF) / 255F;
            float g = ((backgroundColor >> 16) & 0xFF) / 255F;
            float r = ((backgroundColor >> 24) & 0xFF) / 255F;
            background = new ColoredRectangle(0, 0, width, height, r, g, b, a);
            layer.AddChild(background);
            layer.StencilMasks.AddLast(background);

            text = new Label("", font, textColor, wordWrap, LabelSizeMethod.SmallestPossible);
            layer.AddChild(text);

            InteractsWithMouse = true;

            arrow = new ColoredShape();
            arrow.FilledPolygons.AddLast(new Polygon(false,
                0, 5, 1, 1, 1, 1,
                5, 0, 1, 1, 1, 1,
                5, 10, 1, 1, 1, 1));
            arrow.FilledPolygons.AddLast(new Polygon(false,
                5, 3, 1, 1, 1, 1,
                5, 7, 1, 1, 1, 1,
                10, 7, 1, 1, 1, 1,
                10, 3, 1, 1, 1, 1));
            arrow.SetPolygons();
            arrow.Visible = false;
            AddChild(arrow);

            CursorPosition = 0;
            OnChange += OnChangeHandler;

            IllegalChars = new List<char>();
            IllegalChars.Add('\b');
        }
Exemple #4
0
        private void MakeChargeMarker()
        {
            originalChargeMarker = new ColoredShape();
            originalChargeMarker.FilledPolygons.AppendMany(
                new Polygon(false,
                0, 0, 1, 1, 1, 0.7F,
                SIZE, 0, 1, 1, 1, 0.7F,
                SIZE - 5, 5, 1, 1, 1, 0,
                5, 5, 1, 1, 1, 0),

                new Polygon(false,
                SIZE, 0, 1, 1, 1, 0.7F,
                SIZE, SIZE, 1, 1, 1, 0.7F,
                SIZE - 5, SIZE - 5, 1, 1, 1, 0,
                SIZE - 5, 5, 1, 1, 1, 0),

                new Polygon(false,
                SIZE, SIZE, 1, 1, 1, 0.7F,
                0, SIZE, 1, 1, 1, 0.7F,
                5, SIZE - 5, 1, 1, 1, 0,
                SIZE - 5, SIZE - 5, 1, 1, 1, 0),

                new Polygon(false,
                0, SIZE, 1, 1, 1, 0.7F,
                0, 0, 1, 1, 1, 0.7F,
                5, 5, 1, 1, 1, 0,
                5, SIZE - 5, 1, 1, 1, 0));

            originalChargeMarker.SetPolygons();
        }