 |
Gorgon Game Engine
|
Go to the documentation of this file.
172 start(&start), middle(&middle),
end(&
end) {}
176 start(new A_(std::move(start))), middle(new A_(std::move(middle))), end(new A_(std::move(end))),
183 start(start), middle(middle),
end(
end) {}
187 start(other.start), middle(other.middle), end(other.end), own(other.own)
190 other.start =
nullptr;
191 other.middle =
nullptr;
200 auto ret =
new typename std::remove_reference<decltype(*
this)>::type(std::move(*
this));
214 return *
new Line(*
this, timer);
218 return *
new Line(*
this, create);
223 return start->CreateAnimation(
false);
230 return middle->CreateAnimation(
false);
237 return end->CreateAnimation(
false);
312 auto sz = start->GetSize();
318 auto sz = middle->GetSize();
324 auto sz = end->GetSize();
332 auto sz = start->GetSize();
338 auto sz = middle->GetSize();
344 auto sz = end->GetSize();
356 A_ *middle =
nullptr;
virtual RectangularAnimation & CreateEnd() const =0
Creates a start animation without controller. This function should always return an animation.
virtual int GetDuration() const =0
Returns the duration of the animation if it is a known apriori.
void Prepare()
Prepares all animation providers if the they support Prepare function.
Definition: Line.h:282
Orientation
2D orientation constants
Definition: Graphics.h:39
virtual RectangularAnimation & CreateStart() const =0
Creates a start animation without controller. This function should always return an animation.
void OwnProviders()
Issuing this function will make this line to own its providers destroying them along with itself.
Definition: Line.h:293
This class allows control over a sizable object.
Definition: Graphics.h:161
virtual void draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &tex1, const Geometry::Pointf &tex2, const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const override
This method should draw to object inside the given quad with the given texture coordinates.
Definition: Line.cpp:65
static EmptyImage & Instance()
Returns the instance for empty image. Only one instance is enough.
Definition: EmptyImage.h:50
Line & CreateAnimation(bool create=true) const override
This function should create and animation and depending on the create parameter, it should create its...
Definition: Line.h:217
virtual ILineProvider & MoveOutProvider() override=0
This function moves this animation provider into a new provider.
Controllers are required to progress animations.
Definition: Animation.h:65
T_ Height
Height of this size object.
Definition: Size.h:261
basic_LineProvider(Orientation orientation, A_ &start, A_ &middle, A_ &end)
Filling constructor.
Definition: Line.h:171
virtual ~Line()
Definition: Line.h:67
basic_LineProvider(basic_LineProvider &&other)
Move constructor.
Definition: Line.h:186
constexpr Type Line
Definition: GID.h:234
Represents a four channel 32 bit float per channel color information.
Definition: Color.h:373
int GetDuration() const override
Returns the duration of the animation if it is a known apriori.
Definition: Line.h:77
virtual Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: Line.h:105
void SetEnd(A_ *value)
Changes the end animation, ownership semantics will not change.
Definition: Line.h:274
basic_LineProvider(const basic_LineProvider &)=delete
virtual RectangularAnimation & CreateMiddle() const =0
Creates a start animation without controller. This function should always return an animation.
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class represents a 2D geometric size.
Definition: Size.h:23
This class allows drawing a line like image that is made out of three parts.
Definition: Line.h:61
This is the base class for all animations.
Definition: Animation.h:306
virtual Geometry::Size calculatesize(const Geometry::Size &area) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: Line.h:96
virtual RectangularAnimation & CreateEnd() const override
Creates a start animation without controller. This function should always return an animation.
Definition: Line.h:235
Rectangular drawable animation.
Definition: Animations.h:19
Interface for LineProviders.
Definition: Line.h:12
This class allows instancing of a line like image that is made out of three parts.
Definition: Line.h:162
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 t...
Definition: Line.h:213
virtual bool GetTiling() const
Returns if the middle part will be tiled.
Definition: Line.h:47
Line(const ILineProvider &prov, Gorgon::Animation::ControllerBase &timer)
Definition: Line.cpp:17
This interface defines a class that can be used as a common target for texture based drawing.
Definition: TextureTargets.h:12
This class represents a 2D point.
Definition: Point.h:32
A_ * GetEnd() const
Returns the end animation, might return nullptr.
Definition: Line.h:253
virtual void drawin(TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
This function should draw the object to the target area.
Definition: Line.cpp:29
virtual void DeleteAnimation() const
Deletes this animation.
Definition: Animation.h:379
virtual void SetOrientation(Orientation value)
Changes the orientation of the provider.
Definition: Line.h:30
virtual bool Progress(unsigned &) override
This function should progress the animation.
Definition: Line.h:73
void SetMiddle(A_ *value)
Changes the middle animation, ownership semantics will not change.
Definition: Line.h:266
A_ * GetStart() const
Returns the start animation, might return nullptr.
Definition: Line.h:243
This class provides rectangular animations.
Definition: Animations.h:48
@ Graphics
Definition: Template.h:164
virtual Orientation GetOrientation() const
Returns the orientation of the line provider.
Definition: Line.h:35
Geometry::Size GetSize() const override
Definition: Line.h:306
virtual void SetTiling(bool value)
Sets whether the middle part would be tiled.
Definition: Line.h:42
int GetHeight() const
Returns the height of the drawable.
Definition: Drawables.h:451
void ReleaseProviders()
Issuing this function will make this line to disown its providers and set them to nullptr.
Definition: Line.h:299
T_ Width
Width of this size object.
Definition: Size.h:258
virtual RectangularAnimation & CreateStart() const override
Creates a start animation without controller. This function should always return an animation.
Definition: Line.h:221
std::vector< T_ >::const_iterator end(enum_type_id< T_ >)
Definition: Enum.h:288
int getfixedsize() const
Returns the largest size in the non-scalable direction.
Definition: Line.h:124
int GetWidth() const
Returns the width of the drawable.
Definition: Drawables.h:448
basic_LineProvider(Orientation orientation=Orientation::Horizontal)
Empty constructor, line can be instanced even if it is completely empty.
Definition: Line.h:167
Represents a rectangle in a 2D space.
Definition: Rectangle.h:19
ControllerBase * controller
Controller of this animation.
Definition: Animation.h:388
virtual RectangularAnimation & CreateMiddle() const override
Creates a start animation without controller. This function should always return an animation.
Definition: Line.h:228
ILineProvider(Orientation orientation)
Definition: Line.h:14
virtual Geometry::Size calculatesize(const SizeController &controller, const Geometry::Size &s) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: Line.h:114
virtual auto MoveOutProvider() -> decltype(*this) override
This function moves this animation provider into a new provider.
Definition: Line.h:199
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,...
Definition: Line.h:182
~basic_LineProvider()
Definition: Line.h:205
basic_LineProvider(Orientation orientation, A_ &&start, A_ &&middle, A_ &&end)
Filling constructor. This variant will move in the animations, freeing them with this item.
Definition: Line.h:175
void SetStart(A_ *value)
Changes the start animation, ownership semantics will not change.
Definition: Line.h:258
A_ * GetMiddle() const
Returns the middle animation, might return nullptr.
Definition: Line.h:248