72 virtual bool IsExiting()
const {
return m_isExiting; }
79 float GetAlpha()
const {
return m_transitionValue; }
187 bool m_isExiting =
false;
189 bool m_needsToBeRemoved;
191 double m_transitionInTime = 0;
192 double m_transitionOutTime = 0;
196 float m_transitionValue = 0;
197 double m_transitionTime = 0;
204 void TransitionOut();
206 void UpdateTransition(
const GameTime& gameTime);
Represents a four-component color using red, green, blue, and alpha data.
static const Color White
White.
Base class for all games. Provides graphics initialization, game loop, and rendering code....
Contains timing values for game updates and rendering.
Contains a 2D texture that can be used as a render target.
Loads and manages the lifespan of objects from external files.
Base class for all game screens and menus.
virtual bool ShouldUpdateBelow()
Checks if the screen manager should call Update on the screen below this one.
virtual ScreenManager * GetScreenManager()
Gets a pointer to the ScreenManager, for managing game screens.
virtual void Draw(SpriteBatch &spriteBatch)=0
Called when the game determines it is time to draw a frame.
virtual bool ShouldDrawBelow()
Checks if the screen manager should call Draw on the screen below this one.
virtual void LoadContent(ResourceManager &resourceManager)
Called when resources need to be loaded.
virtual void Update(const GameTime &gameTime)=0
Called when the game has determined that screen logic needs to be processed.
virtual bool NeedsToBeRemoved() const
Determines if the screen has completely faded out and needs to be removed by the ScreenManager.
virtual void UnloadContent()
Called when resources need to be unloaded. Override this method to unload any screen-specific resourc...
virtual double GetTransitionInTime() const
Get the time in seconds that the screen will transition in.
virtual void SetExitCallback(OnExit callback)
Sets the callback function for when the Exit() is called.
virtual void UseRenderTarget()
Forces all screen rendering to a render target.
virtual Color GetRenderTargetColor() const
Get the color that will be used to tint the render target.
virtual ScreenTransition GetTransition() const
Get the current transition state of the screen.
virtual float GetTransitionValue() const
Get the interpolated value (between zero and one) of the screen transition.
virtual Game * GetGame() const
Gets a pointer to the Game.
virtual RenderTarget * GetRenderTarget() const
Get screen's render target.
virtual void HandleInput(const InputState &input)
Called when the game has determined that player input needs to be processed.
float GetAlpha() const
Gets the overall screen transition alpha value (or opacity). This is handy for fading screens in and ...
virtual void SetTransitionInTime(double seconds)
Set the time in seconds that the screen should transition in.
virtual void Show()
Tells the screen to transition in.
virtual double GetTransitionOutTime() const
Get the time in seconds that the screen will transition out.
virtual void Exit()
Tells the screen to transition out. When the screen has completed its transition, UnloadContent() wil...
virtual void SetTransitionOutTime(double seconds)
Set the time in seconds that the screen should transition out.
virtual bool IsExiting() const
Determines if the screen is currently exiting.
ScreenTransition
Defines the state of the transition between screens.
@ None
The screen is not transitioning.
@ Out
The screen is transitioning out.
@ In
The screen is transitioning in.
virtual void SetScreenManager(ScreenManager &screenManager)
Gets a pointer to the ScreenManager, for managing game screens.
virtual void SetRemoveCallback(OnRemove callback)
Sets the callback function for when the screen is about to be removed by the screen manager.
virtual bool ShouldHandleInputBelow()
Checks if the screen manager should call HandleInput on the screen below this one.
Updates, renders, and manages transitions between instances of the Screen class.
Enables a group of sprites to be drawn using the same settings.
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
void(* OnRemove)(Screen *pScreen)
Callback function for when a screen has completely exited and is about to be removed by the screen ma...
void(* OnExit)(Screen *pScreen)
Callback function for when Exit() is called on a screen and it begins to transition out.