コード例 #1
0
        public bool RenderBeforeLeavingRoom(List <IObject> displayList)
        {
            _x = _slideIn ? _targetX : 0f;
            _y = _slideIn ? _targetY : 0f;
            float toX = _slideIn ? 0f : _targetX;
            float toY = _slideIn ? 0f : _targetY;

            _tweenX = Tween.RunWithExternalVisit(_x, toX, b => _x = b, _timeInSeconds, _easingX, out _visitTweenX);
            _tweenY = Tween.RunWithExternalVisit(_y, toY, b => _y = b, _timeInSeconds, _easingY, out _visitTweenY);
            return(false);
        }
コード例 #2
0
 public bool RenderTransition(IFrameBuffer from, IFrameBuffer to)
 {
     if (_tween.Task.IsCompleted)
     {
         if (_isFadeIn)
         {
             _isFadeIn = false;
             return(false);
         }
         _isFadeIn = true;
         _tween    = Tween.RunWithExternalVisit(0f, 1f, b => _black = b, _timeInSeconds, _easingFadeIn, out _visitTween);
     }
     _visitTween();
     _screenVectors.Render(_isFadeIn ? to.Texture : from.Texture, _black, _black, _black);
     return(true);
 }
コード例 #3
0
        private async void tweenLabel()
        {
            if (notInRoom())
            {
                return;
            }

            var tween = Tween.RunWithExternalVisit(_label.ScaleX, 1.5f, scale => _label.Scale = new PointF(scale, scale),
                                                   3f, Ease.BounceOut, out _visitTween);

            await tween.Task;

            tween = Tween.RunWithExternalVisit(_label.ScaleX, 1f, scale => _label.Scale = new PointF(scale, scale),
                                               3f, Ease.BounceOut, out _visitTween);

            await tween.Task;

            tweenLabel();
        }
コード例 #4
0
        public bool RenderTransition(IFrameBuffer from, IFrameBuffer to)
        {
            if (_tweenWidth.Task.IsCompleted)
            {
                if (_isBoxIn)
                {
                    _isBoxIn = false;
                    return(false);
                }
                _isBoxIn    = true;
                _tweenWidth = Tween.RunWithExternalVisit(0f, _screenWidth, f => _boxWidth = f, _timeInSeconds, _easingBoxIn, out _visitTweenWidth);
                Tween.RunWithExternalVisit(0f, _screenHeight, f => _boxHeight = f, _timeInSeconds, _easingBoxIn, out _visitTweenHeight);
            }

            _visitTweenWidth();
            _visitTweenHeight();

            if (_isBoxIn)
            {
                _screenVectors.Render(to.Texture);

                float       x      = _screenHalfWidth - _boxWidth / 2;
                float       y      = _screenHalfHeight - _boxHeight / 2;
                QuadVectors left   = new QuadVectors(0f, 0f, x, _screenHeight, _glUtils);
                QuadVectors right  = new QuadVectors(_screenWidth - x, 0f, x, _screenHeight, _glUtils);
                QuadVectors top    = new QuadVectors(0f, 0f, _screenWidth, y, _glUtils);
                QuadVectors bottom = new QuadVectors(0f, _screenHeight - y, _screenWidth, y, _glUtils);
                renderBlackQuads(left, right, top, bottom);
            }
            else
            {
                _screenVectors.Render(from.Texture);
                QuadVectors quad = new QuadVectors(_screenHalfWidth - _boxWidth / 2, _screenHalfHeight - _boxHeight / 2,
                                                   _boxWidth, _boxHeight, _glUtils);
                renderBlackQuads(quad);
            }
            return(true);
        }
コード例 #5
0
 public bool RenderBeforeLeavingRoom(List <IObject> displayList)
 {
     _tweenWidth = Tween.RunWithExternalVisit(0f, _screenWidth, f => _boxWidth = f, _timeInSeconds, _easingBoxOut, out _visitTweenWidth);
     Tween.RunWithExternalVisit(0f, _screenHeight, f => _boxHeight = f, _timeInSeconds, _easingBoxOut, out _visitTweenHeight);
     return(false);
 }
コード例 #6
0
 public bool RenderBeforeLeavingRoom(List <IObject> displayList)
 {
     _tween = Tween.RunWithExternalVisit(0f, 1f, t => _time = t, _timeInSeconds, _easing, out _visitTween);
     return(false);
 }
コード例 #7
0
 public bool RenderBeforeLeavingRoom(System.Collections.Generic.List <IObject> displayList, Action <IObject> renderObj)
 {
     _tween = Tween.RunWithExternalVisit(1f, 0f, b => _alpha = b, _timeInSeconds, _easingFadeOut, out _visitTween);
     return(false);
 }
コード例 #8
0
 public bool RenderBeforeLeavingRoom(List <IObject> displayList)
 {
     _tween = Tween.RunWithExternalVisit(1f, 0f, b => _alpha = b, _timeInSeconds, _easingFadeOut, out _visitTween);
     return(false);
 }