![]() |
FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
|
Public Member Functions | |
ObjSpriteCluster (ObjSpriteCluster const &r) | |
ObjSpriteCluster (fge::Texture texture) | |
fge::Object * | copy () override |
Duplicate the object. | |
void | setTexture (fge::Texture texture) |
void | clear () |
void | addSprite (fge::RectInt const &rectangle, fge::Vector2f const &offset={0.0f, 0.0f}) |
void | resize (std::size_t size) |
void | setTextureRect (std::size_t index, fge::RectInt const &rectangle) |
void | setColor (std::size_t index, fge::Color const &color) |
void | setOffset (std::size_t index, fge::Vector2f const &offset) |
fge::Texture const & | getTexture () const |
std::optional< fge::RectInt > | getTextureRect (std::size_t index) const |
std::optional< fge::Color > | getColor (std::size_t index) const |
std::optional< fge::Vector2f > | getOffset (std::size_t index) const |
void | draw (fge::RenderTarget &target, const fge::RenderStates &states) const override |
Method called every frame to draw the object. | |
void | save (nlohmann::json &jsonObject, fge::Scene *scene) override |
Save the object to a json object. | |
void | load (nlohmann::json &jsonObject, fge::Scene *scene) override |
Load the object from a json object. | |
void | pack (fge::net::Packet &pck) override |
Pack the object into a packet. | |
void | unpack (fge::net::Packet const &pck) override |
Unpack the object from a packet. | |
char const * | getClassName () const override |
Get the unique class name of the object. | |
char const * | getReadableClassName () const override |
Get a readable version of the class name. | |
fge::RectFloat | getGlobalBounds () const override |
Get the global bounds of the object. | |
std::optional< fge::RectFloat > | getGlobalBounds (std::size_t index) const |
fge::RectFloat | getLocalBounds () const override |
Get the local bounds of the object (without any transformations) | |
std::optional< fge::RectFloat > | getLocalBounds (std::size_t index) const |
virtual void | first (fge::Scene &scene) |
Method called when the object is added to a scene for initialization purposes. | |
virtual void | transfered (fge::Scene &oldScene, fge::Scene &newScene) |
Method called when the object is transferred from a scene to another. | |
virtual void | callbackRegister (fge::Event &event, fge::GuiElementHandler *guiElementHandlerPtr) |
Ask the object to register all callbacks it needs to receive events. | |
virtual void | update (fge::RenderWindow &screen, fge::Event &event, std::chrono::microseconds const &deltaTime, fge::Scene &scene) |
Main method called every frame. | |
void | update (fge::RenderWindow &screen, fge::Event &event, std::chrono::microseconds const &deltaTime) |
virtual void | networkRegister () |
Register all network types needed by the object. | |
virtual void | netSignaled (int8_t signal) |
Method called when the object is signaled by the network. | |
virtual void | removed (fge::Scene &scene) |
Method called when the object is removed from a scene. | |
virtual fge::Quad | getGlobalQuad () const |
virtual fge::Quad | getLocalQuad () const |
bool | saveInFile (std::string const &path) |
Save the object in a file. | |
bool | loadFromFile (std::string const &path) |
Load the object from a file. | |
virtual fge::GuiElement * | getGuiElement () |
Get the GuiElement attached to this object if there is one. | |
glm::mat4 | getParentsTransform () const |
Retrieve recursively all parents transform by combining them. | |
fge::Vector2f | getParentsScale () const |
Retrieve recursively all parents scale by combining them. | |
void | setPosition (Vector2f const &position) |
Vector2f const & | getPosition () const |
void | move (Vector2f const &offset) |
void | setRotation (float angle) |
float | getRotation () const |
void | rotate (float angle) |
void | setScale (Vector2f const &factors) |
void | setScale (float factor) |
Vector2f const & | getScale () const |
void | scale (Vector2f const &factor) |
void | scale (float factor) |
void | setOrigin (Vector2f const &origin) |
Vector2f const & | getOrigin () const |
glm::mat4 const & | getTransform () const |
glm::mat4 const & | getInverseTransform () const |
void | updateAnchor (fge::Vector2f const &customTargetSize={0.0f, 0.0f}) |
void | setAnchor (Types type, fge::Vector2< Shifts > const &shift, fge::ObjectSid target=std::numeric_limits< fge::ObjectSid >::max()) |
void | setAnchorType (Types type) |
void | setAnchorShift (fge::Vector2< Shifts > const &shift) |
void | setAnchorTarget (fge::ObjectSid target) |
Types | getAnchorType () const |
fge::Vector2< Shifts > const & | getAnchorShift () const |
fge::ObjectSid | getAnchorTarget () const |
fge::Object * | getAnchorOwner () const |
void | setAnchorSuccessor (fge::ObjectDataWeak successor) |
fge::ObjectDataWeak | getAnchorSuccessor () const |
void | needAnchorUpdate (bool flag) |
bool | isNeedingAnchorUpdate () const |
Static Public Member Functions | |
static fge::Object * | LoadFromFile (std::string const &path) |
Static form of the loadFromFile method. | |
Public Attributes | |
fge::TagList | _tags |
The tags of the object. | |
fge::PropertyList | _properties |
The properties of the object. | |
fge::net::NetworkTypeHandler | _netList |
The network types container of the object. | |
fge::ObjectDataWeak | _myObjectData |
The object data of the object (valid only if the object is in a scene) | |
fge::Object::DrawModes | _drawMode |
Tell a scene when this object should be drawn. | |
fge::Object::CallbackContextModes | _callbackContextMode |
Tell a scene how the callbackRegister must be called. | |
ChildrenControlFlags_t | _childrenControlFlags {CHILDREN_DEFAULT} |
The control flags of the child objects. | |
fge::ChildObjectsAccessor | _children |
An access to child objects of this object. | |
|
virtualinherited |
Ask the object to register all callbacks it needs to receive events.
event | The event system |
guiElementHandlerPtr | The GUI element handler |
Reimplemented in fge::ObjButton, fge::ObjSelectBox, fge::ObjSlider, fge::ObjTextInputBox, fge::ObjTextList, and fge::ObjWindow.
|
inlineoverridevirtual |
Duplicate the object.
By default, if the copy method is not overridden, the object is duplicated with the help of the register manager (and the object class have to be registered).
Reimplemented from fge::Object.
|
overridevirtual |
Method called every frame to draw the object.
target | The target where the object is drawn |
states | The render states |
Reimplemented from fge::Object.
|
virtualinherited |
Method called when the object is added to a scene for initialization purposes.
scene | The scene where the object is added |
Reimplemented in fge::ObjLight, fge::ObjRenderMap, fge::ObjShaderChain, fge::ObjShape, fge::ObjSlider, fge::ObjTextList, and fge::ObjWindow.
|
overridevirtual |
Get the unique class name of the object.
Reimplemented from fge::Object.
|
nodiscardoverridevirtual |
Get the global bounds of the object.
Reimplemented from fge::Object.
|
virtualinherited |
Get the GuiElement attached to this object if there is one.
Reimplemented in fge::ObjButton, fge::ObjSelectBox, fge::ObjSlider, fge::ObjTextInputBox, and fge::ObjWindow.
|
nodiscardoverridevirtual |
Get the local bounds of the object (without any transformations)
Reimplemented from fge::Object.
|
inherited |
Retrieve recursively all parents scale by combining them.
|
inherited |
Retrieve recursively all parents transform by combining them.
|
overridevirtual |
Get a readable version of the class name.
Reimplemented from fge::Object.
|
overridevirtual |
Load the object from a json object.
jsonObject | The json object where the object is loaded |
scene | The scene where the object is loaded (can be nullptr) |
Reimplemented from fge::Object.
|
staticinherited |
Static form of the loadFromFile method.
path | The path of the file |
|
inherited |
Load the object from a file.
path | The path of the file |
|
virtualinherited |
Method called when the object is signaled by the network.
signal | The signal received |
|
virtualinherited |
Register all network types needed by the object.
|
overridevirtual |
Pack the object into a packet.
pck | The packet where the object is packed |
Reimplemented from fge::Object.
|
virtualinherited |
Method called when the object is removed from a scene.
scene | The scene where the object is removed |
Reimplemented in fge::ObjRenderMap, and fge::ObjWindow.
|
overridevirtual |
Save the object to a json object.
jsonObject | The json object where the object is saved |
scene | The scene where the object is saved (can be nullptr) |
Reimplemented from fge::Object.
|
inherited |
Save the object in a file.
path | The path of the file |
|
virtualinherited |
Method called when the object is transferred from a scene to another.
This method is called after the object is removed from the old scene and added to the new scene. The _myObjectData is updated to the new scene when this method is called.
oldScene | The old scene where the object was |
newScene | The new scene where the object is |
|
overridevirtual |
Unpack the object from a packet.
pck | The packet where the object is unpacked |
Reimplemented from fge::Object.
|
virtualinherited |
Main method called every frame.
screen | The screen where the object is drawn |
event | The event system |
deltaTime | The time since the last frame |
scene | The scene where the object is updated |
Reimplemented in fge::ObjAnimation, fge::ObjLight, fge::ObjRenderMap, fge::ObjSwitch, and fge::ObjWindow.
|
inherited |
Tell a scene how the callbackRegister must be called.
|
inherited |
An access to child objects of this object.
|
inherited |
The control flags of the child objects.
|
inherited |
Tell a scene when this object should be drawn.
|
inherited |
The object data of the object (valid only if the object is in a scene)
|
inherited |
The network types container of the object.
|
inherited |
The properties of the object.
|
inherited |
The tags of the object.