public bool RenderTransition(IFrameBuffer from, IFrameBuffer to) { if (_tweenX.Task.IsCompleted && _tweenY.Task.IsCompleted) { return(false); } if (!_tweenX.Task.IsCompleted) { _visitTweenX(); } if (!_tweenY.Task.IsCompleted) { _visitTweenY(); } var quad = new QuadVectors(_x, _y, _width, _height, _glUtils); if (_slideIn) { _screenVectors.Render(from.Texture); quad.Render(to.Texture); } else { _screenVectors.Render(to.Texture); quad.Render(from.Texture); } return(true); }
public bool RenderTransition(IFrameBuffer from, IFrameBuffer to) { if (_tween.Task.IsCompleted) { return(false); } _visitTween(); var oldShader = AGSGame.Shader; _screenVectors.Render(to.Texture); var shader = _game.Factory.Shaders.FromText(null, FRAGMENT_SHADER).Compile(); if (shader == null) { return(false); } shader.Bind(); if (!shader.SetVariable("time", _time)) { shader.Unbind(); return(false); } _screenVectors.Render(from.Texture); if (oldShader != null) { oldShader.Bind(); } else { shader.Unbind(); } return(true); }
public bool RenderTransition(IFrameBuffer from, IFrameBuffer to) { if (_tween.Task.IsCompleted) { return(false); } _visitTween(); _screenVectors.Render(to.Texture); _screenVectors.Render(from.Texture, a: _alpha); return(true); }
public bool RenderTransition(IFrameBuffer from, IFrameBuffer to) { if (_tweenX.Task.IsCompleted && _tweenY.Task.IsCompleted) { return false; } if (!_tweenX.Task.IsCompleted) _visitTweenX(); if (!_tweenY.Task.IsCompleted) _visitTweenY(); var quad = new QuadVectors (_x, _y, _width, _height, _glUtils); if (_slideIn) { _screenVectors.Render(from.Texture); quad.Render(to.Texture); } else { _screenVectors.Render(to.Texture); quad.Render(from.Texture); } return true; }
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); }
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); }