Exemple #1
0
        public void Update(float deltaTime)
        {
            if (IsKeyPressed(KeyboardKey.KEY_ENTER))
            {
                if (Tween.Socket.Connected)
                {
                    tweenX.Link();
                }
            }

            if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
            {
                tweenX.Play(X, GetMouseX());
                tweenY.Play(Y, GetMouseY());
            }

            // Only one tween can interact with the editor at a time, so tweenX gets the properties and copies them to tweenY.
            tweenY.CopyFrom(tweenX);

            if (tweenX.IsPlaying)
            {
                X = (int)tweenX.Update(deltaTime);
            }
            if (tweenY.IsPlaying)
            {
                Y = (int)tweenY.Update(deltaTime);
            }
        }