21 #include "hx3d/graphics/fade_transition.hpp" 23 #include "hx3d/graphics/sprite.hpp" 24 #include "hx3d/core/core.hpp" 25 #include "hx3d/window/game.hpp" 26 #include "hx3d/window/application.hpp" 55 batch.
draw(spriteNext);
60 spriteCurrent.
setTint(
Color(255, 255, 255, 255 - alpha));
63 batch.
draw(spriteCurrent);
FadeTransition(window::Game *game, Color color=Color::Black)
Create a fading transition with a color.
float _currentTime
Current time in seconds.
static window::Game * CurrentGame()
Get the game instance.
void setTint(Color tint)
Set the mesh tint.
Game main class: multiple screens management.
virtual void render(Batch &batch, Framebuffer ¤tFB, Framebuffer &nextFB) override
Render the transition.
Four [0..255] components defined color.
void setTexture(const Ptr< Texture > &texture)
Set the sprite texture.
virtual void end() override
End the batching.
Transition between two screens.
virtual void onStart() override
On transition start callback.
glm::vec2 getSize()
Get the current game size.
virtual void onDone() override
On transition done callback.
float _duration
Duration in seconds.
Simple base batch implementation. Draw at each draw call.
virtual void onUpdate(float delta) override
On transition update callback.
virtual void begin() override
Begin the batching.
virtual void draw(Mesh &mesh) override
Draw the mesh.
Transform transform
Mesh transformation.
Render-to-texture buffer.
static void clear(Color color)
Clear the framebuffer.