![]() |
FastEngine 0.9.4
A multiplayer oriented 2D engine made with Vulkan.
|
Classes | |
struct | InstanceData |
Public Member Functions | |
void | setTexture (Texture const &texture, bool resetRect=false) |
void | setTextureRect (fge::RectInt const &rect) |
void | setFillColor (Color color, std::size_t instance=0) |
void | setOutlineColor (Color color, std::size_t instance=0) |
void | setOffset (fge::Vector2f const &offset, std::size_t instance=0) |
void | setInstancesCount (std::size_t count) |
void | addInstance (Color fillColor, Color outlineColor, fge::Vector2f const &offset) |
std::size_t | getInstancesCount () const |
void | clearInstances () |
void | setOutlineThickness (float thickness) |
Texture const & | getTexture () const |
RectInt const & | getTextureRect () const |
Color | getFillColor (std::size_t instance=0) const |
Color | getOutlineColor (std::size_t instance=0) const |
fge::Vector2f const & | getOffset (std::size_t instance=0) const |
float | getOutlineThickness () const |
virtual std::size_t | getPointCount () const =0 |
virtual Vector2f | getPoint (std::size_t index) const =0 |
void | first (fge::Scene &scene) override |
Method called when the object is added to a scene for initialization purposes. | |
void | draw (fge::RenderTarget &target, const fge::RenderStates &states) const override |
Method called every frame to draw the object. | |
fge::RectFloat | getLocalBounds () const override |
Get the local bounds of the object (without any transformations) | |
fge::RectFloat | getGlobalBounds () const override |
Get the global bounds of the object. | |
virtual fge::Object * | copy () |
Duplicate the object. | |
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::RenderTarget &target, fge::Event &event, fge::DeltaTime const &deltaTime, fge::Scene &scene) |
Main method called every frame. | |
void | update (fge::RenderTarget &target, fge::Event &event, fge::DeltaTime 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 void | save (nlohmann::json &jsonObject) |
Save the object to a json object. | |
virtual void | load (nlohmann::json &jsonObject, std::filesystem::path const &filePath) |
Load the object from a json object. | |
virtual void | pack (fge::net::Packet &pck) |
Pack the object into a packet. | |
virtual void | unpack (fge::net::Packet const &pck) |
Unpack the object from a packet. | |
virtual char const * | getClassName () const |
Get the unique class name of the object. | |
virtual char const * | getReadableClassName () const |
Get a readable version of the class name. | |
virtual fge::Quad | getGlobalQuad () const |
virtual fge::Quad | getLocalQuad () const |
bool | saveInFile (std::filesystem::path const &path, int fieldWidth=2, bool saveClassName=true) |
Save the object in a file. | |
bool | loadFromFile (std::filesystem::path const &path, bool loadClassName=true) |
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 | centerOriginFromLocalBounds () |
Center the origin of the object from its local bounds. | |
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 |
View & | createOwnView () |
void | removeOwnView () |
bool | hasOwnView () const |
std::shared_ptr< View > const & | getOwnView () const |
void | setOwnView (std::shared_ptr< View > view) |
void | ownViewOverrideParent (bool enable) |
bool | isOwnViewOverridingParent () const |
void | ownViewExplicitlySetDefaultView (bool enable) |
bool | isOwnViewUsingExplicitDefaultView () const |
View const & | requestView (View const &source, fge::ObjectDataWeak object) const |
View const & | requestView (View const &source, OwnView const &parent) const |
View const & | requestView (View const &source) const |
View const & | requestView (fge::RenderTarget const &source, fge::ObjectDataWeak object) const |
View const & | requestView (fge::RenderTarget const &source, OwnView const &parent) const |
View const & | requestView (fge::RenderTarget const &source) const |
Static Public Member Functions | |
static std::unique_ptr< fge::Object > | LoadFromFile (std::filesystem::path 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) | |
DrawModes | _drawMode {DrawModes::DRAW_DEFAULT} |
Tell a scene when this object should be drawn. | |
CallbackContextModes | _callbackContextMode |
Tell a scene how the callbackRegister must be called. | |
NetSyncModes | _netSyncMode {NetSyncModes::NETSYNC_DEFAULT} |
Tell a scene how the object must be synchronised. | |
net::Identity | _netOwner {} |
The owner of the object. | |
ChildrenControlFlags_t | _childrenControlFlags {CHILDREN_DEFAULT} |
The control flags of the child objects. | |
fge::ChildObjectsAccessor | _children |
An access to child objects of this object. |
Protected Member Functions | |
ObjShape (ObjShape const &r) | |
void | updateShape () |
|
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.
|
inherited |
Center the origin of the object from its local bounds.
|
virtualinherited |
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 in fge::ObjAnimation, fge::ObjButton, fge::ObjLight, fge::ObjRenderMap, fge::ObjShaderChain, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, fge::ObjTileLayer, and fge::ObjWindow.
|
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.
|
overridevirtual |
Method called when the object is added to a scene for initialization purposes.
scene | The scene where the object is added |
Reimplemented from fge::Object.
|
virtualinherited |
Get the unique class name of the object.
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjCircleShape, fge::ObjLight, fge::ObjLineShape, fge::ObjRectangleShape, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjShaderChain, fge::ObjSlider, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, fge::ObjTextInputBox, fge::ObjTextList, fge::ObjTileLayer, and fge::ObjWindow.
|
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.
|
virtualinherited |
Get a readable version of the class name.
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjCircleShape, fge::ObjLight, fge::ObjLineShape, fge::ObjRectangleShape, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjShaderChain, fge::ObjSlider, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, fge::ObjTextInputBox, fge::ObjTextList, fge::ObjTileLayer, and fge::ObjWindow.
|
virtualinherited |
Load the object from a json object.
jsonObject | The json object where the object is loaded |
filePath | The path of the main file where the object is loaded from |
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjLight, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, and fge::ObjTextInputBox.
|
staticnodiscardinherited |
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 |
loadClassName | Load and verify the class name |
|
virtualinherited |
Method called when the object is signaled by the network.
signal | The signal received |
|
virtualinherited |
Register all network types needed by the object.
|
virtualinherited |
Pack the object into a packet.
pck | The packet where the object is packed |
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjLight, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, and fge::ObjTextInputBox.
|
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.
|
virtualinherited |
Save the object to a json object.
jsonObject | The json object where the object is saved |
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjLight, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, and fge::ObjTextInputBox.
|
inherited |
Save the object in a file.
path | The path of the file |
fieldWidth | The width of the fields in the file |
saveClassName | If the class name must be saved |
|
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 |
|
virtualinherited |
Unpack the object from a packet.
pck | The packet where the object is unpacked |
Reimplemented in fge::ObjAnimation, fge::ObjButton, fge::ObjLight, fge::ObjRenderMap, fge::ObjSelectBox, fge::ObjSprite, fge::ObjSpriteBatches, fge::ObjSpriteCluster, fge::ObjSwitch, fge::ObjText, and fge::ObjTextInputBox.
|
virtualinherited |
Main method called every frame.
target | The target 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 owner of the object.
|
inherited |
Tell a scene how the object must be synchronised.
|
inherited |
The properties of the object.
|
inherited |
The tags of the object.