1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __I_GUI_IN_OUT_FADER_H_INCLUDED__
6
#define __I_GUI_IN_OUT_FADER_H_INCLUDED__
8
#include "IGUIElement.h"
16
//! Element for fading out or in
17
/** Here is a small example on how the class is used. In this example we fade
18
in from a total red screen in the beginning. As you can see, the fader is not
19
only useful for dramatic in and out fading, but also to show that the player
20
is hit in a first person shooter game for example.
22
gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader();
23
fader->setColor(video::SColor(0,255,0,0));
27
class IGUIInOutFader : public IGUIElement
32
IGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
33
: IGUIElement(EGUIET_IN_OUT_FADER, environment, parent, id, rectangle) {}
35
//! Gets the color to fade out to or to fade in from.
36
virtual video::SColor getColor() const = 0;
38
//! Sets the color to fade out to or to fade in from.
39
/** \param color: Color to where it is faded out od from it is faded in. */
40
virtual void setColor(video::SColor color) = 0;
41
virtual void setColor(video::SColor source, video::SColor dest) = 0;
43
//! Starts the fade in process.
44
/** In the beginning the whole rect is drawn by the set color
45
(black by default) and at the end of the overgiven time the
47
\param time: Time specifying how long it should need to fade in,
49
virtual void fadeIn(u32 time) = 0;
51
//! Starts the fade out process.
52
/** In the beginning everything is visible, and at the end of
53
the time only the set color (black by the fault) will be drawn.
54
\param time: Time specifying how long it should need to fade out,
56
virtual void fadeOut(u32 time) = 0;
58
//! Returns if the fade in or out process is done.
59
virtual bool isReady() const = 0;
63
} // end namespace gui
64
} // end namespace irr