![]() |
Gorgon Game Engine
|
This class allows instancing of a rectangle like image that is made out of three parts. More...
Public Types | |
using | AnimationType = Rectangle |
![]() | |
using | AnimationType = RectangularAnimation |
![]() | |
using | AnimationType = Animation |
![]() | |
using | AnimationType = Base |
Public Member Functions | |
basic_RectangleProvider () | |
Empty constructor, rectangle can be instanced even if it is completely empty. More... | |
basic_RectangleProvider (A_ &&border) | |
Filling constructor using move semantics, rectangle will create and own new object. More... | |
basic_RectangleProvider (A_ &&border, A_ &¢er) | |
Filling constructor using move semantics, rectangle will create and own new objects. More... | |
basic_RectangleProvider (A_ &&tl, A_ &&tm, A_ &&tr, A_ &&ml, A_ &&mm, A_ &&mr, A_ &&bl, A_ &&bm, A_ &&br) | |
Filling constructor using move semantics, rectangle will create and own new objects. More... | |
basic_RectangleProvider (A_ &border) | |
Filling constructor. More... | |
basic_RectangleProvider (A_ &border, A_ ¢er) | |
Filling constructor. More... | |
basic_RectangleProvider (A_ &tl, A_ &tm, A_ &tr, A_ &ml, A_ &mm, A_ &mr, A_ &bl, A_ &bm, A_ &br) | |
Filling constructor. More... | |
basic_RectangleProvider (A_ *tl, A_ *tm, A_ *tr, A_ *ml, A_ *mm, A_ *mr, A_ *bl, A_ *bm, A_ *br) | |
Filling constructor, nullptr is acceptable. More... | |
basic_RectangleProvider (basic_RectangleProvider &&other) | |
Move constructor. More... | |
basic_RectangleProvider (const basic_RectangleProvider &)=delete | |
~basic_RectangleProvider () | |
Rectangle & | 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... | |
Rectangle & | 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 & | CreateBL () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateBM () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateBR () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateML () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateMM () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateMR () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateTL () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateTM () const override |
Creates an animation without controller. This function should always return an animation. More... | |
virtual RectangularAnimation & | CreateTR () const override |
Creates an animation without controller. This function should always return an animation. More... | |
A_ * | GetBL () const |
Returns BL provider, may return nullptr. More... | |
A_ * | GetBM () const |
Returns BM provider, may return nullptr. More... | |
A_ * | GetBR () const |
Returns BR provider, may return nullptr. More... | |
A_ * | GetML () const |
Returns ML provider, may return nullptr. More... | |
A_ * | GetMM () const |
Returns MM provider, may return nullptr. More... | |
A_ * | GetMR () const |
Returns MR provider, may return nullptr. More... | |
Geometry::Size | GetSize () const override |
A_ * | GetTL () const |
Returns TL provider, may return nullptr. More... | |
A_ * | GetTM () const |
Returns TM provider, may return nullptr. More... | |
A_ * | GetTR () const |
Returns TR provider, may return nullptr. More... | |
virtual auto | MoveOutProvider () -> decltype(*this) override |
This function moves this animation provider into a new provider. More... | |
basic_RectangleProvider & | operator= (const basic_RectangleProvider &)=delete |
void | OwnProviders () |
Issuing this function will make this rectangle to own its providers, destroying them along with itself. More... | |
void | Prepare () |
Prepares all animation providers if the they support Prepare function. More... | |
void | SetBL (A_ *value) |
Changes the BL animation, ownership semantics will not change. More... | |
void | SetBM (A_ *value) |
Changes the BM animation, ownership semantics will not change. More... | |
void | SetBR (A_ *value) |
Changes the BR animation, ownership semantics will not change. More... | |
void | SetML (A_ *value) |
Changes the ML animation, ownership semantics will not change. More... | |
void | SetMM (A_ *value) |
Changes the MM animation, ownership semantics will not change. More... | |
void | SetMR (A_ *value) |
Changes the MR animation, ownership semantics will not change. More... | |
void | SetTL (A_ *value) |
Changes the TL animation, ownership semantics will not change. More... | |
void | SetTM (A_ *value) |
Changes the TM animation, ownership semantics will not change. More... | |
void | SetTR (A_ *value) |
Changes the TR animation, ownership semantics will not change. More... | |
![]() | |
IRectangleProvider () | |
virtual bool | GetCenterTiling () const |
Returns if the middle part will be tiled. More... | |
virtual bool | GetSideTiling () const |
Returns if the middle part will be tiled. More... | |
virtual void | SetCenterTiling (bool value) |
Sets whether the middle part would be tiled. More... | |
virtual void | SetSideTiling (bool value) |
Sets whether the side parts (tm, ml, mr, bm) would be tiled. More... | |
![]() | |
int | GetHeight () const |
int | GetWidth () const |
![]() | |
virtual | ~AnimationProvider () |
![]() | |
virtual | ~Provider () |
Virtual destructor. More... | |
This class allows instancing of a rectangle like image that is made out of three parts.
The first part is the start of the rectangle, the second part is the middle and the third part is the end of the rectangle. Middle part can be repeated or stretched. A rectangle provider can have empty animations. Provider will use EmptyImage for missing parts. A_ must derive from RectangularAnimationProvider. For best results, try to keep size of parts compatible. If an image is smaller, it will be placed towards the center. Part names follows a logic, first letter is vertical location, second is horizontal. For instance TL is top left, ML is directly the left of the middle section. Any part that has an M in it will be scaled/tiled.
using AnimationType = Rectangle |
Empty constructor, rectangle can be instanced even if it is completely empty.
|
delete |
basic_RectangleProvider | ( | A_ & | tl, |
A_ & | tm, | ||
A_ & | tr, | ||
A_ & | ml, | ||
A_ & | mm, | ||
A_ & | mr, | ||
A_ & | bl, | ||
A_ & | bm, | ||
A_ & | br | ||
) |
Filling constructor.
basic_RectangleProvider | ( | A_ && | tl, |
A_ && | tm, | ||
A_ && | tr, | ||
A_ && | ml, | ||
A_ && | mm, | ||
A_ && | mr, | ||
A_ && | bl, | ||
A_ && | bm, | ||
A_ && | br | ||
) |
Filling constructor using move semantics, rectangle will create and own new objects.
The given objects will be moved to these new objects.
|
explicit |
Filling constructor.
The given object will be used for the borders. Center will be empty
|
explicit |
Filling constructor using move semantics, rectangle will create and own new object.
The given object will be moved to this new object. The given object will be used for the borders
basic_RectangleProvider | ( | A_ & | border, |
A_ & | center | ||
) |
Filling constructor.
The first given object will be used for the borders. The second will be used for the center
|
explicit |
Filling constructor using move semantics, rectangle will create and own new objects.
The given objects will be moved to these new objects. The first object will be used for the borders, the second will be used for center
basic_RectangleProvider | ( | A_ * | tl, |
A_ * | tm, | ||
A_ * | tr, | ||
A_ * | ml, | ||
A_ * | mm, | ||
A_ * | mr, | ||
A_ * | bl, | ||
A_ * | bm, | ||
A_ * | br | ||
) |
Filling constructor, nullptr is acceptable.
basic_RectangleProvider | ( | basic_RectangleProvider< A_ > && | other | ) |
Move constructor.
References IRectangleProvider::SetCenterTiling(), and IRectangleProvider::SetSideTiling().
|
overridevirtual |
This function should create and animation and depending on the create parameter, it should create its own timer.
Implements RectangularAnimationProvider.
|
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.
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
|
overridevirtual |
Creates an animation without controller. This function should always return an animation.
Implements IRectangleProvider.
References EmptyImage::Instance().
A_* GetBL | ( | ) | const |
Returns BL provider, may return nullptr.
A_* GetBM | ( | ) | const |
Returns BM provider, may return nullptr.
A_* GetBR | ( | ) | const |
Returns BR provider, may return nullptr.
A_* GetML | ( | ) | const |
Returns ML provider, may return nullptr.
A_* GetMM | ( | ) | const |
Returns MM provider, may return nullptr.
A_* GetMR | ( | ) | const |
Returns MR provider, may return nullptr.
|
overridevirtual |
Implements RectangularAnimationProvider.
A_* GetTL | ( | ) | const |
Returns TL provider, may return nullptr.
A_* GetTM | ( | ) | const |
Returns TM provider, may return nullptr.
A_* GetTR | ( | ) | const |
Returns TR provider, may 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 IRectangleProvider.
|
delete |
void OwnProviders | ( | ) |
Issuing this function will make this rectangle to own its providers, destroying them along with itself.
void Prepare | ( | ) |
Prepares all animation providers if the they support Prepare function.
void SetBL | ( | A_ * | value | ) |
Changes the BL animation, ownership semantics will not change.
void SetBM | ( | A_ * | value | ) |
Changes the BM animation, ownership semantics will not change.
void SetBR | ( | A_ * | value | ) |
Changes the BR animation, ownership semantics will not change.
void SetML | ( | A_ * | value | ) |
Changes the ML animation, ownership semantics will not change.
void SetMM | ( | A_ * | value | ) |
Changes the MM animation, ownership semantics will not change.
void SetMR | ( | A_ * | value | ) |
Changes the MR animation, ownership semantics will not change.
void SetTL | ( | A_ * | value | ) |
Changes the TL animation, ownership semantics will not change.
void SetTM | ( | A_ * | value | ) |
Changes the TM animation, ownership semantics will not change.
void SetTR | ( | A_ * | value | ) |
Changes the TR animation, ownership semantics will not change.