 |
Gorgon Game Engine
|
Go to the documentation of this file.
3 #include "../Graphics.h"
133 base(&base), color(color)
137 base(new A_(std::move(base))), color(color), own(true)
141 base(other.base), color(other.color)
143 other.base =
nullptr;
154 auto ret =
new typename std::remove_reference<decltype(*
this)>::type(std::move(*
this));
170 return base->CreateAnimation(
false);
208 if(base) base->Prepare();
225 base(parent.CreateBase()), color(parent.GetColor())
235 base(parent.CreateBase()), color(parent.GetColor())
244 base.DrawIn(target, r, this->color*color);
249 base.DrawIn(target, controller, r, this->color*color);
260 base.Draw(target, p1, p2, p3, p4, tex1, tex2, tex3, tex4, this->color*color);
268 base.Draw(target, p1, p2, p3, p4, this->color*color);
273 return base.GetSize();
virtual int GetDuration() const =0
Returns the duration of the animation if it is a known apriori.
Base(ControllerBase &controller)
Sets the controller for this animation to the given controller.
Definition: Animation.h:310
This class allows control over a sizable object.
Definition: Graphics.h:161
static EmptyImage & Instance()
Returns the instance for empty image. Only one instance is enough.
Definition: EmptyImage.h:50
basic_TintedObject< A_ > & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
Definition: TintedObject.h:163
virtual void drawin(TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
This function should draw the object to the target area.
Definition: TintedObject.h:243
basic_TintedObjectProvider(A_ &&base, const RGBAf &color=1.f)
Definition: TintedObject.h:136
virtual bool Progress(unsigned &) override
This function should progress the animation.
Definition: TintedObject.h:74
Controllers are required to progress animations.
Definition: Animation.h:65
basic_TintedObjectProvider(A_ &base, const RGBAf &color=1.f)
Filling constructor.
Definition: TintedObject.h:132
virtual void SetColor(const RGBAf &value)=0
typename A_::AnimationType AnimationType
Definition: TintedObject.h:126
Represents a four channel 32 bit float per channel color information.
Definition: Color.h:373
This object creates a scalable object from a graphic object.
Definition: TintedObject.h:124
virtual void draw(TextureTarget &target, const Geometry::Pointf &p, RGBAf color) const=0
This is the only function that needs to implemented for a drawable.
For ease of use in resource system.
Definition: TintedObject.h:11
void SetColor(const RGBAf &value) override
Sets the tint color of the object.
Definition: TintedObject.h:188
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: TintedObject.h:87
virtual RectangularAnimation & CreateBase() const =0
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class represents a 2D geometric size.
Definition: Size.h:23
basic_TintedObject(RectangularAnimation &base, const RGBAf &color, Gorgon::Animation::ControllerBase &timer)
Creates a scalable object from two animations, these animations should not have controllers attached ...
Definition: TintedObject.h:49
RectangularAnimation & CreateBase() const override
Creates a base animation without controller.
Definition: TintedObject.h:168
Rectangular drawable animation.
Definition: Animations.h:19
void SetColor(RGBAf value)
Changes the size controller used in this scalable object.
Definition: TintedObject.h:65
~basic_TintedObjectProvider()
Definition: TintedObject.h:146
basic_TintedObjectProvider()=default
Empty constructor.
virtual auto MoveOutProvider() -> decltype(*this) override
Definition: TintedObject.h:153
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
virtual void DeleteAnimation() const
Deletes this animation.
Definition: Animation.h:379
Definition: TintedObject.h:26
A regular drawable animation.
Definition: Animations.h:14
Geometry::Size GetSize() const override
Definition: TintedObject.h:211
RGBAf GetColor() const override
Returns the tint color.
Definition: TintedObject.h:183
This class provides rectangular animations.
Definition: Animations.h:48
virtual bool HasController() const
Returns whether this animation has a controller.
Definition: Animation.h:344
@ Graphics
Definition: Template.h:164
virtual void RemoveController()
Removes the controller of this animation.
Definition: Animation.h:357
A_ * GetBase() const
Returns the base component. Could return nullptr.
Definition: TintedObject.h:178
void SetBase(A_ *value)
Sets the base provider, ownership semantics will not be changed.
Definition: TintedObject.h:193
void OwnProvider()
Assumes the ownership of the providers.
Definition: TintedObject.h:201
basic_TintedObjectProvider(basic_TintedObjectProvider &&other)
Definition: TintedObject.h:140
basic_TintedObject(const basic_TintedObjectProvider< A_ > &parent, bool create=true)
Definition: TintedObject.h:223
virtual void SetController(ControllerBase &controller)
Sets the controller to the given controller.
Definition: Animation.h:334
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: TintedObject.h:91
virtual void draw(TextureTarget &target, const Geometry::Pointf &p, RGBAf color) const =0
This is the only function that needs to implemented for a drawable.
basic_TintedObject(RectangularAnimation &base, const RGBAf &color, bool create=true)
Creates a scalable object from two animations, these animations should not have controllers attached ...
Definition: TintedObject.h:35
void Prepare()
Prepares the providers.
Definition: TintedObject.h:207
const Geometry::Size CalculateSize(const Geometry::Size &area) const
Calculates the adjusted size of this drawable depending on the given area.
Definition: Drawables.h:322
basic_TintedObject< A_ > & CreateAnimation(bool create=true) const override
Definition: TintedObject.h:159
Represents a rectangle in a 2D space.
Definition: Rectangle.h:19
ControllerBase * controller
Controller of this animation.
Definition: Animation.h:388
virtual RGBAf GetColor() const =0
virtual Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: TintedObject.h:272
RGBAf GetColor() const
Returns the size controller used in this scalable object.
Definition: TintedObject.h:70
virtual ITintedObjectProvider & MoveOutProvider() override=0
This function moves this animation provider into a new provider.
~basic_TintedObject()
Definition: TintedObject.h:60
virtual ControllerBase & GetController() const
Returns the controller of this animation.
Definition: Animation.h:347
int GetDuration() const override
Returns the duration of the animation if it is a known apriori.
Definition: TintedObject.h:78