![]() |
Gorgon Game Engine
|
This class allows instancing of a line like image that is made out of three parts. More...
Public Types | |
using | AnimationType = Line |
![]() | |
using | AnimationType = RectangularAnimation |
![]() | |
using | AnimationType = Animation |
![]() | |
using | AnimationType = Base |
Public Member Functions | |
basic_LineProvider (basic_LineProvider &&other) | |
Move constructor. More... | |
basic_LineProvider (const basic_LineProvider &)=delete | |
basic_LineProvider (Orientation orientation, A_ &&start, A_ &&middle, A_ &&end) | |
Filling constructor. This variant will move in the animations, freeing them with this item. More... | |
basic_LineProvider (Orientation orientation, A_ &start, A_ &middle, A_ &end) | |
Filling constructor. More... | |
basic_LineProvider (Orientation orientation, A_ *start, A_ *middle, A_ *end) | |
Filling constructor, nullptr is acceptable, however, it is not advised to use only one side, that is a waste of resources, a regular image can also be tiled or stretched to fit to an area. More... | |
basic_LineProvider (Orientation orientation=Orientation::Horizontal) | |
Empty constructor, line can be instanced even if it is completely empty. More... | |
~basic_LineProvider () | |
Line & | CreateAnimation (bool create=true) const override |
This function should create and animation and depending on the create parameter, it should create its own timer. More... | |
Line & | CreateAnimation (Gorgon::Animation::ControllerBase &timer) const override |
This function should create a new animation with the given controller and if owner parameter is set to true, it should assume ownership of the controller. More... | |
virtual RectangularAnimation & | CreateEnd () const override |
Creates a start animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateMiddle () const override |
Creates a start animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateStart () const override |
Creates a start animation without controller. This function should always return an animation. More... | |
A_ * | GetEnd () const |
Returns the end animation, might return nullptr. More... | |
A_ * | GetMiddle () const |
Returns the middle animation, might return nullptr. More... | |
Geometry::Size | GetSize () const override |
A_ * | GetStart () const |
Returns the start animation, might return nullptr. More... | |
virtual auto | MoveOutProvider () -> decltype(*this) override |
This function moves this animation provider into a new provider. More... | |
void | OwnProviders () |
Issuing this function will make this line to own its providers destroying them along with itself. More... | |
void | Prepare () |
Prepares all animation providers if the they support Prepare function. More... | |
void | ReleaseProviders () |
Issuing this function will make this line to disown its providers and set them to nullptr. More... | |
void | SetEnd (A_ *value) |
Changes the end animation, ownership semantics will not change. More... | |
void | SetMiddle (A_ *value) |
Changes the middle animation, ownership semantics will not change. More... | |
void | SetStart (A_ *value) |
Changes the start animation, ownership semantics will not change. More... | |
![]() | |
ILineProvider (Orientation orientation) | |
virtual Orientation | GetOrientation () const |
Returns the orientation of the line provider. More... | |
virtual bool | GetTiling () const |
Returns if the middle part will be tiled. More... | |
virtual void | SetOrientation (Orientation value) |
Changes the orientation of the provider. More... | |
virtual void | SetTiling (bool value) |
Sets whether the middle part would be tiled. More... | |
![]() | |
int | GetHeight () const |
int | GetWidth () const |
![]() | |
virtual | ~AnimationProvider () |
![]() | |
virtual | ~Provider () |
Virtual destructor. More... | |
This class allows instancing of a line like image that is made out of three parts.
The first part is the start of the line, the second part is the middle and the third part is the end of the line. Middle part can be repeated or stretched. A line provider can have empty animations. Provider will use EmptyImage for missing parts. A_ must derive from RectangularAnimationProvider. For best results, try to keep height of parts same for horizontal, widths same for vertical lines.
using AnimationType = Line |
|
explicit |
Empty constructor, line can be instanced even if it is completely empty.
basic_LineProvider | ( | Orientation | orientation, |
A_ & | start, | ||
A_ & | middle, | ||
A_ & | end | ||
) |
Filling constructor.
References Gorgon::end().
basic_LineProvider | ( | Orientation | orientation, |
A_ && | start, | ||
A_ && | middle, | ||
A_ && | end | ||
) |
Filling constructor. This variant will move in the animations, freeing them with this item.
basic_LineProvider | ( | Orientation | orientation, |
A_ * | start, | ||
A_ * | middle, | ||
A_ * | end | ||
) |
Filling constructor, nullptr is acceptable, however, it is not advised to use only one side, that is a waste of resources, a regular image can also be tiled or stretched to fit to an area.
References Gorgon::end().
basic_LineProvider | ( | basic_LineProvider< A_ > && | other | ) |
Move constructor.
References ILineProvider::SetTiling().
|
delete |
~basic_LineProvider | ( | ) |
|
overridevirtual |
This function should create and animation and depending on the create parameter, it should create its own timer.
Implements RectangularAnimationProvider.
References Gorgon::Resource::GID::Line.
|
overridevirtual |
This function should create a new animation with the given controller and if owner parameter is set to true, it should assume ownership of the controller.
Implements RectangularAnimationProvider.
References Gorgon::Resource::GID::Line.
|
overridevirtual |
Creates a start animation without controller. This function should always return an animation.
Implements ILineProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates a start animation without controller. This function should always return an animation.
Implements ILineProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates a start animation without controller. This function should always return an animation.
Implements ILineProvider.
References EmptyImage::Instance().
A_* GetEnd | ( | ) | const |
Returns the end animation, might return nullptr.
A_* GetMiddle | ( | ) | const |
Returns the middle animation, might return nullptr.
|
overridevirtual |
Implements RectangularAnimationProvider.
References ILineProvider::GetOrientation(), and Gorgon::Graphics::Horizontal.
A_* GetStart | ( | ) | const |
Returns the start animation, might return nullptr.
|
overridevirtual |
This function moves this animation provider into a new provider.
Ownership of this new object belongs to the caller and this object could be destroyed safely.
Implements ILineProvider.
void OwnProviders | ( | ) |
Issuing this function will make this line to own its providers destroying them along with itself.
void Prepare | ( | ) |
Prepares all animation providers if the they support Prepare function.
void ReleaseProviders | ( | ) |
Issuing this function will make this line to disown its providers and set them to nullptr.
void SetEnd | ( | A_ * | value | ) |
Changes the end animation, ownership semantics will not change.
void SetMiddle | ( | A_ * | value | ) |
Changes the middle animation, ownership semantics will not change.
void SetStart | ( | A_ * | value | ) |
Changes the start animation, ownership semantics will not change.