Beispiel #1
0
    public override void _Process(float delta)
    {
        if (Input.IsActionPressed("ui_space") && !Input.IsActionPressed("ui_shift"))
        {
            Vector2 mousePos = GetGlobalMousePosition();
            endPos = mousePos.Snapped(new Vector2(fullTile, fullTile));
            if (!posIsSet)
            {
                startPos            = endPos;
                posIsSet            = true;
                GlobalPosition      = mousePos;
                LengthLabel.Visible = true;
                Input.SetMouseMode(Input.MouseMode.Hidden);
            }
            LengthLabel.SetGlobalPosition(mousePos);
            Update();
        }

        if (Input.IsActionJustReleased("ui_space"))
        {
            posIsSet            = false;
            LengthLabel.Visible = false;
            Input.SetMouseMode(Input.MouseMode.Visible);
            Update();
        }
    }
Beispiel #2
0
        void ReleaseDesignerOutlets()
        {
            if (LengthLabel != null)
            {
                LengthLabel.Dispose();
                LengthLabel = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ReversedLabel != null)
            {
                ReversedLabel.Dispose();
                ReversedLabel = null;
            }

            if (LengthLabel != null)
            {
                LengthLabel.Dispose();
                LengthLabel = null;
            }

            if (TextEditor != null)
            {
                TextEditor.Dispose();
                TextEditor = null;
            }
        }