Beispiel #1
0
    private static void setPosition(Vector2 position)
    {
        // Convert position from "screen coordinates" to "gui coordinates"
        position = _sprite.GetManager().ScreenToGui(position);

        // Center the control on the mouse/touch
        _sprite.RelativePosition = position - _cursorOffset;
    }
    public static void SetPosition(Vector2 position)
    {
        // Convert position from "screen coordinates" to "gui coordinates"
        position = _sprite.GetManager().ScreenToGui(position);

        // Center the control on the mouse/touch
        _sprite.RelativePosition = position - _sprite.Size * 0.5f;
    }