Exemple #1
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsJoystickExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinJoystick",
                          _("Joysticks features"),
                          _("Built-in extension allowing to use joysticks"),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)
    extension.AddCondition("JoystickButtonDown",
                   _("A button of a joystick is pressed"),
                   _("Test if a button of a joystick is pressed."),
                   _("The button _PARAM2_ of joystick _PARAM1_ is pressed"),
                   _("Joystick"),
                   "res/conditions/joystick24.png",
                   "res/conditions/joystick.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Joystick number (first joystick: 0)"))
        .AddParameter("expression", _("Button"));

    extension.AddCondition("JoystickAxis",
                   _("Value of an axis of a joystick"),
                   _("Test the value of an axis of a joystick."),
                   _("The value of the axis _PARAM2_ of joystick _PARAM1_ is _PARAM3__PARAM4_"),
                   _("Joystick"),
                   "res/conditions/joystick24.png",
                   "res/conditions/joystick.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Joystick number (first joystick: 0)"))
        .AddParameter("joyaxis", _("Axis"))
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetManipulatedType("number");

    extension.AddAction("GetJoystickAxis",
                   _("Get the value of the axis of a joystick"),
                   _("Save in the variable the value of the axis of the joystick (from -100 to 100)."),
                   _("Save in _PARAM3_ the value of axis _PARAM2_ of joystick _PARAM1_"),
                   _("Joystick"),
                   "res/actions/joystick24.png",
                   "res/actions/joystick.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Joystick number (first joystick: 0)"))
        .AddParameter("joyaxis", _("Axis"))
        .AddParameter("scenevar", _("Save result to scene variable"))
        .SetManipulatedType("number");

    extension.AddExpression("GetJoystickAxis",
                   _("Joystick axis"),
                   _("Value of an axis of a joystick"),
                   _("Joystick"),
                   "res/conditions/joystick.png")

        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Joystick number (first joystick: 0)"))
        .AddParameter("joyaxis", _("Axis"));
    #endif
}
Exemple #2
0
void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("DestroyOutsideBehavior",
                              _("Destroy Outside Screen Behavior"),
                              _("Behavior destroying object when they go outside the screen"),
                              "Florian Rival",
                              "Open source (MIT License)");

    gd::BehaviorMetadata & aut = extension.AddBehavior("DestroyOutside",
          _("Destroy when outside the screen"),
          _("DestroyOutside"),
          _("Automatically destroy the object when it goes outside the screen"),
          "",
          "CppPlatform/Extensions/destroyoutsideicon.png",
          "DestroyOutsideBehavior",
          std::shared_ptr<gd::Behavior>(new DestroyOutsideBehavior),
          std::shared_ptr<gd::BehaviorsSharedData>());

    #if defined(GD_IDE_ONLY)
    aut.SetIncludeFile("DestroyOutsideBehavior/DestroyOutsideBehavior.h");

    aut.AddCondition("ExtraBorder",
                   _("Additional border"),
                   _("Compare the additional border that the object must cross before being deleted."),
                   _("The additional border of _PARAM0_ is _PARAM2__PARAM3_"),
                   _(""),
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "DestroyOutside")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetFunctionName("GetExtraBorder").SetManipulatedType("number")
        .SetIncludeFile("DestroyOutsideBehavior/DestroyOutsideBehavior.h");

    aut.AddAction("ExtraBorder",
                   _("Additional border"),
                   _("Change the additional border that the object must cross before being deleted."),
                   _("Do _PARAM2__PARAM3_ to the additional border of _PARAM0_"),
                   _(""),
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "DestroyOutside")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetExtraBorder").SetManipulatedType("number")
        .SetGetter("GetExtraBorder").SetIncludeFile("DestroyOutsideBehavior/DestroyOutsideBehavior.h");
    #endif

}
Exemple #3
0
void DeclareDestroyOutsideAutomatismExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("DestroyOutsideAutomatism",
                              _("Destroy Outside Screen Automatism"),
                              _("Automatism destroying object when they go outside the screen"),
                              "Florian Rival",
                              "zlib/libpng License (Open Source)");

    gd::AutomatismMetadata & aut = extension.AddAutomatism("DestroyOutside",
          _("Destroy when outside the screen"),
          _("DestroyOutside"),
          _("Automatically destroy the object when it goes outside the screen"),
          "",
          "CppPlatform/Extensions/destroyoutsideicon.png",
          "DestroyOutsideAutomatism",
          boost::shared_ptr<gd::Automatism>(new DestroyOutsideAutomatism),
          boost::shared_ptr<gd::AutomatismsSharedData>());

    #if defined(GD_IDE_ONLY)
    aut.SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");

    aut.AddCondition("ExtraBorder",
                   _("Additional border"),
                   _("Compare the additional border that the object must cross before being deleted."),
                   _("The additional border of _PARAM0_ is _PARAM2__PARAM3_"),
                   _(""),
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("automatism", _("Automatism"), "DestroyOutside", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .codeExtraInformation.SetFunctionName("GetExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");

    aut.AddAction("ExtraBorder",
                   _("Additional border"),
                   _("Change the additional border that the object must cross before being deleted."),
                   _("Do _PARAM2__PARAM3_ to the additional border of _PARAM0_"),
                   _(""),
                   "CppPlatform/Extensions/destroyoutsideicon24.png",
                   "CppPlatform/Extensions/destroyoutsideicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("automatism", _("Automatism"), "DestroyOutside", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .codeExtraInformation.SetFunctionName("SetExtraBorder").SetManipulatedType("number")
        .SetAssociatedGetter("GetExtraBorder").SetIncludeFile("DestroyOutsideAutomatism/DestroyOutsideAutomatism.h");
    #endif

}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsExternalLayoutsExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinExternalLayouts",
                          _("External layouts"),
                          _("Built-in extension providing actions and conditions related to external layouts"),
                          "Florian Rival",
                          "Freeware");

    #if defined(GD_IDE_ONLY)
    extension.AddAction("CreateObjectsFromExternalLayout",
                   _("Create objects from an external layout"),
                   _("Create objects from an external layout."),
                   _("Create objects from the external layout _PARAM1_"),
                   _("External layouts"),
                   "res/conditions/fichier24.png",
                   "res/conditions/fichier.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Name of the external layout"), "",false)
        .AddParameter("expression", _("X position of the origin"), "",true).SetDefaultValue("0")
        .AddParameter("expression", _("Y position of the origin"), "",true).SetDefaultValue("0");
    #endif
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCommonConversionsExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinCommonConversions",
                          _("Standard Conversions"),
                          _("Built-in extension providing standard conversions expressions."),
                          "Florian Rival",
                          "Freeware");

    #if defined(GD_IDE_ONLY)

    extension.AddExpression("ToNumber",
                       _("Text > Number"),
                       _("Convert the text to a number"),
                       _("Conversion"),
                       "res/conditions/toujours24.png")
        .AddParameter("string", _("Text to convert in a number"), "",false);

    extension.AddStrExpression("ToString",
                       _("Number > Text"),
                       _("Convert the result of the expression in a text"),
                       _("Conversion"),
                       "res/conditions/toujours24.png")
        .AddParameter("expression", _("Expression to be converted to a text"), "",false);

    extension.AddStrExpression("LargeNumberToString",
                       _("Number > Text ( without scientific notation )"),
                       _("Convert the result of the expression in a text, without using the scientific notation"),
                       _("Conversion"),
                       "res/conditions/toujours24.png")
        .AddParameter("expression", _("Expression to be converted to a text"), "",false);

    extension.AddExpression("ToRad",
                       _("Degrees > Radians"),
                       _("Converts the angle, expressed in degrees, into radians"),
                       _("Conversion"),
                       "res/conditions/toujours24.png")
        .AddParameter("expression", _("Angle, in degrees"), "",false);


    extension.AddExpression("ToDeg",
                       _("Radians > Degrees"),
                       _("Converts the angle, expressed in radians, into degrees"),
                       _("Conversion"),
                       "res/conditions/toujours24.png")
        .AddParameter("expression", _("Angle, in radians"), "",false);
    #endif
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsNetworkExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinNetwork",
                                      _("Basic internet features"),
                                      _("Built-in extension providing network features."),
                                      "Florian Rival",
                                      "Open source (MIT License)");

#if defined(GD_IDE_ONLY)
    extension.AddAction("EnvoiDataNet",
                        _("Send datas to a website"),
                        _("Send datas to a specified web site.\nYou need to set up a .php page on your web site so as to receive this datas.\nEnter here a password, and enter the same in the configuration of your .php page.\nRead the help file to get more informations."),
                        _("Send to _PARAM0_ the following datas : _PARAM2_, _PARAM3_,_PARAM4_,_PARAM5_,_PARAM6_,_PARAM7_"),
                        _("Network"),
                        "res/actions/net24.png",
                        "res/actions/net.png")
    .AddParameter("string", _(".php page URL (don't forget the protocol http://)"))
    .AddParameter("password", _("Password"))
    .AddParameter("string", _("Data 1"))
    .AddParameter("string", _("Data 2"), "", true)
    .AddParameter("string", _("Data 3"), "", true)
    .AddParameter("string", _("Data 4"), "", true)
    .AddParameter("string", _("Data 5"), "", true)
    .AddParameter("string", _("Data 6"), "", true)
    .SetHidden();

    extension.AddAction("SendRequest",
                        _("Send a request to a web page"),
                        _("Send a request to the specified web page.\n\nPlease note that for the web platform games, the game must be hosted on the same host as specified below, except if the server is configured to answer to all requests (cross-domain requests)."),
                        _("Send _PARAM3_ request to _PARAM0__PARAM1_ with body: _PARAM2_"),
                        _("Network"),
                        "res/actions/net24.png",
                        "res/actions/net.png")
    .AddParameter("string", _("Host (example: http://www.some-server.org/)"))
    .AddParameter("string", _("Path to page (Example: /page.php)"))
    .AddParameter("string", _("Request body content"))
    .AddParameter("string", _("Method: \"POST\" or \"GET\" (if empty, GET will be used)"), "", true ).SetDefaultValue("\"GET\"")
    .AddParameter("string", _("Content type (application/x-www-form-urlencoded by default)"), "", true )
    .AddParameter("scenevar", _("Store the response in this variable"), "", true )
    .MarkAsComplex();

    extension.AddAction("DownloadFile",
                        _("Download a file"),
                        _("Download a file from a web site"),
                        _("Download file _PARAM1_ from _PARAM0_ under the name of _PARAM2_"),
                        _("Network"),
                        "res/actions/net24.png",
                        "res/actions/net.png")
    .AddParameter("string", _("Host (for example : http://www.website.com)"))
    .AddParameter("string", _("Path to file (for example : /folder/file.txt)"))
    .AddParameter("string", _("Save as"));

    extension.AddAction("JSONToVariableStructure",
                        _("Convert JSON to variable"),
                        _("Parse a JSON object and store it into a variable"),
                        _("Parse JSON string _PARAM0_ and store it into variable _PARAM1_"),
                        _("Network"),
                        "res/actions/net24.png",
                        "res/actions/net.png")
    .AddParameter("string", _("JSON string"))
    .AddParameter("scenevar", _("Variable where store the JSON object"))
    .MarkAsAdvanced();

    extension.AddStrExpression("ToJSON",
                               _("Convert to JSON"),
                               _("Convert a variable to JSON"),
                               _("Conversion"),
                               "res/conditions/toujours24.png")
    .AddParameter("scenevar", _("The variable to be stringify"));
#endif
}
Exemple #7
0
void DeclarePlatformAutomatismExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("PlatformAutomatism",
                          _("Platform Automatism"),
                          _("Allows to use controllable objects which can run and jump on platforms."),
                          "Florian Rival",
                          "Open source (MIT License)");

    {
        gd::AutomatismMetadata & aut = extension.AddAutomatism("PlatformerObjectAutomatism",
              _("Platformer character"),
              "PlatformerObject",
              _("Controllable character which can jump and run on platforms."),
              "",
              "CppPlatform/Extensions/platformerobjecticon.png",
              "PlatformerObjectAutomatism",
              std::shared_ptr<gd::Automatism>(new PlatformerObjectAutomatism),
              std::shared_ptr<gd::AutomatismsSharedData>(new gd::AutomatismsSharedData));

        #if defined(GD_IDE_ONLY)
        aut.SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsMoving",
                       _("Is moving"),
                       _("Check if the object is moving (whether it is on the floor or in the air)."),
                       _("_PARAM0_ is moving"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsMoving").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsOnFloor",
                       _("Is on floor"),
                       _("Check if the object is on a platform."),
                       _("_PARAM0_ is on floor"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsOnFloor").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsOnLadder",
                       _("Is on ladder"),
                       _("Check if the object is on a ladder."),
                       _("_PARAM0_ is on ladder"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("IsOnLadder").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsJumping",
                       _("Is jumping"),
                       _("Check if the object is jumping."),
                       _("_PARAM0_ is jumping"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("IsJumping").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("IsFalling",
                       _("Is falling"),
                       _("Check if the object is falling.\nNote that the object can be flagged as jumping and falling at the same time: At the end of a jump, the fall speed becomes higher that the jump speed."),
                       _("_PARAM0_ is falling"),
                       "",
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("IsFalling").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("Gravity",
                       _("Gravity"),
                       _("Compare the gravity applied on the object (in pixels per second per second)."),
                       _("Gravity of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetGravity").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("Gravity",
                       _("Gravity"),
                       _("Change the gravity applied on an object (in pixels per second per second)."),
                       _("Do _PARAM2__PARAM3_ to the gravity applied on _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .MarkAsAdvanced()
            .SetFunctionName("SetGravity").SetManipulatedType("number").SetGetter("GetGravity").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("MaxFallingSpeed",
                       _("Maximum falling speed"),
                       _("Compare the maximum falling speed of the object (in pixels per second)."),
                       _("The maximum falling speed of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetMaxFallingSpeed").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("MaxFallingSpeed",
                       _("Maximum falling speed"),
                       _("Change the maximum falling speed of an object (in pixels per second)."),
                       _("Do _PARAM2__PARAM3_ to the maximum falling speed of _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .MarkAsAdvanced()
            .SetFunctionName("SetMaxFallingSpeed").SetManipulatedType("number").SetGetter("GetMaxFallingSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("Acceleration",
                       _("Acceleration"),
                       _("Compare the acceleration of the object (in pixels per second per second)."),
                       _("The acceleration of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetAcceleration").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("Acceleration",
                       _("Acceleration"),
                       _("Change the acceleration of an object (in pixels per second per second)."),
                       _("Do _PARAM2__PARAM3_ to the acceleration of _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .MarkAsAdvanced()
            .SetFunctionName("SetAcceleration").SetManipulatedType("number").SetGetter("GetAcceleration").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("Deceleration",
                       _("Deceleration"),
                       _("Compare the deceleration of the object (in pixels per second per second)."),
                       _("The deceleration of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetDeceleration").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("Deceleration",
                       _("Deceleration"),
                       _("Change the deceleration of an object (in pixels per second per second)."),
                       _("Do _PARAM2__PARAM3_ to the deceleration of _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .MarkAsAdvanced()
            .SetFunctionName("SetDeceleration").SetManipulatedType("number").SetGetter("GetDeceleration").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("MaxSpeed",
                       _("Maximum speed"),
                       _("Compare the maximum speed of the object (in pixels per second)."),
                       _("The maximum speed of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .SetFunctionName("GetMaxSpeed").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("MaxSpeed",
                       _("Maximum speed"),
                       _("Change the maximum speed of an object (in pixels per second)."),
                       _("Do _PARAM2__PARAM3_ to the maximum speed of _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .MarkAsAdvanced()
            .SetFunctionName("SetMaxSpeed").SetManipulatedType("number").SetGetter("GetMaxSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddCondition("JumpSpeed",
                       _("Jump speed"),
                       _("Compare the jump speed of the object (in pixels per second)."),
                       _("The jump speed of _PARAM0_ is _PARAM2__PARAM3_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("relationalOperator", _("Comparison sign"))
            .AddParameter("expression", _("Value to test"))
            .MarkAsAdvanced()
            .SetFunctionName("GetJumpSpeed").SetManipulatedType("number").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("JumpSpeed",
                       _("Jump speed"),
                       _("Change the jump speed of an object (in pixels per second)."),
                       _("Do _PARAM2__PARAM3_ to the jump speed of _PARAM0_"),
                       _("Options"),
                       "CppPlatform/Extensions/platformerobjecticon24.png",
                       "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("operator", _("Modification's sign"))
            .AddParameter("expression", _("Value"))
            .SetFunctionName("SetJumpSpeed").SetManipulatedType("number").SetGetter("GetJumpSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SetCanJump",
                       _("Allow again jumping"),
                       _("Allow the object to jump again, even if it is in the air: this can be useful to allow double jump for example."),
                       _("Allow _PARAM0_ to jump again"),
                       _("Options"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsSimple()
            .SetFunctionName("SetCanJump").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateLeftKey",
                       _("Simulate left key press"),
                       _("Simulate a pressing on left key."),
                       _("Simulate pressing Left for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("SimulateLeftKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateRightKey",
                       _("Simulate right key press"),
                       _("Simulate a pressing on right key."),
                       _("Simulate pressing Right for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("SimulateRightKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateUpKey",
                       _("Simulate up key press"),
                       _("Simulate a pressing on up key ( Used when on a ladder )."),
                       _("Simulate pressing Up for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("SimulateUpKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateDownKey",
                       _("Simulate down key press"),
                       _("Simulate a pressing on down key ( Used when on a ladder )."),
                       _("Simulate pressing Down for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("SimulateDownKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateLadderKey",
                       _("Simulate ladder key press"),
                       _("Simulate a pressing on ladder key ( Used to grab a ladder )."),
                       _("Simulate pressing Ladder key for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .MarkAsAdvanced()
            .SetFunctionName("SimulateLadderKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateJumpKey",
                       _("Simulate jump key press"),
                       _("Simulate a pressing on jump key."),
                       _("Simulate pressing Jump key for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("SimulateJumpKey").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("SimulateControl",
                       _("Simulate control"),
                       _("Simulate a pressing on a key.\nValid keys are Left, Right, Jump, Ladder, Up, Down."),
                       _("Simulate pressing _PARAM2_ key for _PARAM0_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("string", _("Key"))
            .MarkAsAdvanced()
            .SetFunctionName("SimulateControl").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddAction("IgnoreDefaultControls",
                       _("Ignore default controls"),
                       _("De/activate the use of default controls.\nIf deactivated, use the simulate actions to move the object."),
                       _("Ignore default controls for _PARAM0_: _PARAM2_"),
                       _("Controls"),
                       "res/conditions/keyboard24.png",
                       "res/conditions/keyboard.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .AddParameter("yesorno", _("Ignore controls"))
            .MarkAsAdvanced()
            .SetFunctionName("IgnoreDefaultControls").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("Gravity", _("Gravity"), _("Get the gravity applied on the object"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetGravity").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("MaxFallingSpeed", _("Maximum falling speed"), _("Get the maximum falling speed"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetMaxFallingSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("Acceleration", _("Acceleration"), _("Acceleration"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetAcceleration").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("Deceleration", _("Deceleration"), _("Deceleration"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetDeceleration").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("MaxSpeed", _("Maximum speed"), _("Maximum speed"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetMaxSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");

        aut.AddExpression("JumpSpeed", _("Jump speed"), _("Jump speed"), _("Options"), "CppPlatform/Extensions/platformerobjecticon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformerObjectAutomatism")
            .SetFunctionName("GetJumpSpeed").SetIncludeFile("PlatformAutomatism/PlatformerObjectAutomatism.h");
        #endif
    }
    {
        gd::AutomatismMetadata & aut = extension.AddAutomatism("PlatformAutomatism",
              _("Platform"),
              "Platform",
              _("Platform on which Platformer characters can run."),
              "",
              "CppPlatform/Extensions/platformicon.png",
              "PlatformAutomatism",
              std::shared_ptr<gd::Automatism>(new PlatformAutomatism),
              std::shared_ptr<gd::AutomatismsSharedData>(new gd::AutomatismsSharedData));

        #if defined(GD_IDE_ONLY)
        aut.SetIncludeFile("PlatformAutomatism/PlatformAutomatism.h");

        aut.AddAction("ChangePlatformType",
                       _("Change platform type"),
                       _("Change the platform type of the object: Platform, Jumpthru or Ladder."),
                       _("Set platform type of _PARAM0_ to _PARAM2_"),
                       _("Platforms"),
                       "CppPlatform/Extensions/platformicon24.png",
                       "CppPlatform/Extensions/platformicon16.png")
            .AddParameter("object", _("Object"))
            .AddParameter("automatism", _("Automatism"), "PlatformAutomatism")
            .AddParameter("string", _("Platform type (\"Platform\", \"Jumpthru\" or \"Ladder\")"))
            .MarkAsAdvanced()
            .SetFunctionName("ChangePlatformType").SetIncludeFile("PlatformAutomatism/PlatformAutomatism.h");
        #endif
    }
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSceneExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinScene",
                          _("Scene management features"),
                          _("Built-in extension allowing to manipulate scenes"),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)

    extension.AddExpression("Random", _("Random value"), _("Random value"), _("Random"), "res/actions/position.png")
        .AddParameter("expression", _("Maximum value"));

    extension.AddStrExpression("CurrentSceneName", _("Current scene name"), _("Name of the current scene"), _("Scene"), "res/actions/texte.png")
        .AddCodeOnlyParameter("currentScene", "");

    extension.AddCondition("DepartScene",
                   _("At the beginning of the scene"),
                   _("Is true only when scene just begins."),
                   _("At the beginning of the scene"),
                   _("Scene"),
                   "res/conditions/depart24.png",
                   "res/conditions/depart.png")
        .AddCodeOnlyParameter("currentScene", "")
        .MarkAsSimple();

    extension.AddAction("Scene",
                   _("Change the scene"),
                   _("Stop this scene and start the specified one instead."),
                   _("Change for scene _PARAM1_"),
                   _("Scene"),
                   "res/actions/replaceScene24.png",
                   "res/actions/replaceScene.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Name of the new scene"))
        .AddParameter("yesorno", _("Stop any other paused scenes?")).SetDefaultValue("true")
        .MarkAsAdvanced();

    extension.AddAction("PushScene",
                   _("Pause and start a new scene"),
                   _("Pause this scene and start the specified one.\nLater, you can use \"Stop and go back to previous scene\" action to go back to this scene."),
                   _("Pause the scene and start _PARAM1_"),
                   _("Scene"),
                   "res/actions/pushScene24.png",
                   "res/actions/pushScene.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Name of the new scene"))
        .MarkAsAdvanced();

    extension.AddAction("PopScene",
                   _("Stop and go back to previous scene"),
                   _("Stop this scene and go back to the previous paused one.\nTo pause a scene, use \"Pause and start a new scene\" action."),
                   _("Stop the scene and go back to the previous paused one"),
                   _("Scene"),
                   "res/actions/popScene24.png",
                   "res/actions/popScene.png")
        .AddCodeOnlyParameter("currentScene", "")
        .MarkAsAdvanced();

    extension.AddAction("Quit",
                   _("Quit the game"),
                   _("Quit the game"),
                   _("Quit the game"),
                   _("Scene"),
                   "res/actions/quit24.png",
                   "res/actions/quit.png")
        .AddCodeOnlyParameter("currentScene", "")
        .MarkAsAdvanced();

    extension.AddAction("SceneBackground",
                   _("Change background color"),
                   _("Change the background color of the scene."),
                   _("Set background color to _PARAM1_"),
                   _("Scene"),
                   "res/actions/background24.png",
                   "res/actions/background.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("color", _("Color"))
        .MarkAsAdvanced();

    extension.AddAction("DisableInputWhenFocusIsLost",
                   _("Disable input when focus is lost"),
                   _("Set if the keyboard and mouse buttons must be taken into account even\nif the window is not active."),
                   _("Disable input when focus is lost: _PARAM1_"),
                   _("Scene"),
                   "res/actions/window24.png",
                   "res/actions/window.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("yesorno", _("Deactivate input when focus is lost"))
        .MarkAsAdvanced();

    extension.AddCondition("Egal",
               _("Compare two expressions"),
               _("Test the two expression"),
               _("_PARAM0_ _PARAM1_ _PARAM2_"),
               _("Other"),
               "res/conditions/egal24.png",
               "res/conditions/egal.png")
        .AddParameter("expression", _("Expression 1"))
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Expression 2"))
        .MarkAsAdvanced();
    #endif
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCommonInstructionsExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinCommonInstructions",
                          _("Standard events"),
                          _("Built-in extension providing standard events."),
                          "Florian Rival",
                          "Open source (MIT License)");

#if defined(GD_IDE_ONLY)
    extension.AddCondition("Or",
               _("Or"),
               _("Return true if one of the sub conditions is true"),
               _("If one of these conditions is true:"),
               _("Advanced"),
               "res/conditions/or24.png",
               "res/conditions/or.png")
        .SetCanHaveSubInstructions()
        .MarkAsAdvanced();

    extension.AddCondition("And",
               _("And"),
               _("Return true if all sub conditions are true"),
               _("If all of these conditions are true:"),
               _("Advanced"),
               "res/conditions/and24.png",
               "res/conditions/and.png")
        .SetCanHaveSubInstructions()
        .MarkAsAdvanced();

    extension.AddCondition("Not",
               _("Not"),
               _("Return the contrary of the result of the sub conditions"),
               _("Invert the logical result of these conditions:"),
               _("Advanced"),
               "res/conditions/not24.png",
               "res/conditions/not.png")
        .SetCanHaveSubInstructions()
        .MarkAsAdvanced();

    extension.AddCondition("Once",
               _("Trigger once while true"),
               _("Run actions only once, for each time the conditions have been met."),
               _("Trigger once"),
               _("Advanced"),
               "res/conditions/once24.png",
               "res/conditions/once.png");

    extension.AddEvent("Standard", _("Standard event"),
              _("Standard event: Actions are run if conditions are fulfilled."),
              "", "res/eventaddicon.png",
              std::make_shared<gd::StandardEvent>());

    extension.AddEvent("Link", _("Link"),
              _("Link to some external events"),
              "", "res/lienaddicon.png",
              std::make_shared<gd::LinkEvent>());

    extension.AddEvent("Comment", _("Comment"),
              _("Event displaying a text in the events editor"),
              "", "res/comment.png",
              std::make_shared<gd::CommentEvent>());

    extension.AddEvent("While", _("While"),
              _("The event is repeated while the conditions are true"),
              "", "res/while.png",
              std::make_shared<gd::WhileEvent>());

    extension.AddEvent("Repeat", _("Repeat"),
              _("Event repeated a number of times"),
              "", "res/repeat.png",
              std::make_shared<gd::RepeatEvent>());

    extension.AddEvent("ForEach", _("For each object"),
              _("Repeat the event for each specified object."),
              "", "res/foreach.png",
              std::make_shared<gd::ForEachEvent>());

    extension.AddEvent("Group", _("Group"),
              _("Group containing events"),
              "", "res/foreach.png",
              std::make_shared<gd::GroupEvent>());
#endif
}
Exemple #10
0
void DeclareAdMobObjectExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("AdMobObject",
                          _("AdMob banners and interstitial screens"),
                          _("Display ads banner and interstitial screens powered by AdMob."),
                          "Florian Rival",
                          "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject<AdMobObject>(
               "AdMob",
               _("AdMob banner"),
               _("Display an ad banner or interstitial screen using AdMob"),
               "JsPlatform/Extensions/admobicon.png");

    obj.SetHelpUrl("/gdevelop/documentation/manual/built_admob");

    #if !defined(GD_NO_WX_GUI)
    AdMobObject::LoadEdittimeIcon();
    #endif

    obj.AddAction("ShowBanner",
        _("Show banner ad"),
        _("Show the banner ad"),
        _("Show the banner ad of _PARAM0_"),
        _("Banner"),
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");

    obj.AddAction("HideBanner",
        _("Hide banner ad"),
        _("Hide the banner ad"),
        _("Hide the banner ad of _PARAM0_"),
        _("Banner"),
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");

    obj.AddCondition("BannerDisplayed",
        _("Banner is displayed"),
        _("Return true if the object is currently displaying a banner"),
        _("_PARAM0_ is displaying a banner"),
        "",
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");

    obj.AddAction("PreloadInterstitial",
        _("Preload interstitial screen"),
        _("Preload the interstitial screen in memory, so that it can be shown later.\nYou can use this action at the beginning of a level for example."),
        _("Preload an interstitial screen for _PARAM0_"),
        _("Interstitial screen"),
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");

    obj.AddAction("ShowInterstitial",
        _("Show interstitial screen"),
        _("Show the interstitial screen.\nIf the interstitial screen has not been preloaded, it will be loaded and displayed when ready."),
        _("Show the interstitial screen of _PARAM0_"),
        _("Interstitial screen"),
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");

    obj.AddCondition("InterstitialReady",
        _("Interstitial screen is ready"),
        _("Return true if the interstitial screen was loaded and is ready to be shown."),
        _("Interstitial screen of _PARAM0_ is ready"),
        "",
        "JsPlatform/Extensions/admobicon24.png",
        "JsPlatform/Extensions/admobicon16.png")
        .AddParameter("object", _("Object"), "AdMob");
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinMathematicalTools",
                          _("Mathematical tools"),
                          _("Built-in extension providing mathematical tools"),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)

    extension.AddExpression("AngleDifference", _("Difference between two angles"), _("Difference between two angles"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("First angle"))
        .AddParameter("expression", _("Second angle"));


    extension.AddExpression("mod", _("Modulo"), _("x mod y"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("x (as in x mod y)"))
        .AddParameter("expression", _("y (as in x mod y)"));


    extension.AddExpression("min", _("Minimum of two numbers"), _("Minimum of two numbers"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("First expression"))
        .AddParameter("expression", _("Second expression"));


    extension.AddExpression("max", _("Maximum of two numbers"), _("Maximum of two numbers"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("First expression"))
        .AddParameter("expression", _("Second expression"));


    extension.AddExpression("abs", _("Absolute value"), _("Absolute value"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("acos", _("Arccosine"), _("Arccosine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("acosh", _("Hyperbolic arccosine"), _("Hyperbolic arccosine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("asin", _("Arcsine"), _("Arcsine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("asinh", _("Arcsine"), _("Arcsine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("atan", _("Arctangent"), _("Arctangent"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("atan2", _("2 argument arctangent"), _("2 argument arctangent (atan2)"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Y"))
        .AddParameter("expression", _("X"));


    extension.AddExpression("atanh", _("Hyperbolic arctangent"), _("Hyperbolic arctangent"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("cbrt", _("Cube root"), _("Cube root"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("ceil", _("Ceil (round up)"), _("Round number up to an integer"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("floor", _("Floor (round down)"), _("Round number down to an integer"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("cos", _("Cosine"), _("Cosine of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("cosh", _("Hyperbolic cosine"), _("Hyperbolic cosine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("cot", _("Cotangent"), _("Cotangent of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("csc", _("Cosecant"), _("Cosecant of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("int", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
        .SetHidden()
        .AddParameter("expression", _("Expression"));

    extension.AddExpression("rint", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
        .SetHidden()
        .AddParameter("expression", _("Expression"));

    extension.AddExpression("round", _("Round"), _("Round a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("exp", _("Exponential"), _("Exponential of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("log", _("Logarithm"), _("Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("ln", _("Logarithm"), _("Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
        .SetHidden()
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("log2", _("Base-2 logarithm"), _("Base 2 Logarithm"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("log10", _("Base-10 logarithm"), _("Base-10 logarithm"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("nthroot", _("Nth root"), _("Nth root of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Number"))
        .AddParameter("expression", _("N"));


    extension.AddExpression("pow", _("Power"), _("Raise a number to power n"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Number"))
        .AddParameter("expression", _("The exponent (n in x^n)"));


    extension.AddExpression("sec", _("Secant"), _("Secant"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("sign", _("Sign of a number"), _("Return the sign of a number (1,-1 or 0)"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("sin", _("Sine"), _("Sine of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("sinh", _("Hyperbolic sine"), _("Hyperbolic sine"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("sqrt", _("Square root"), _("Square root of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("tan", _("Tangent"), _("Tangent of a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));


    extension.AddExpression("tanh", _("Hyperbolic tangent"), _("Hyperbolic tangent"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));

    extension.AddExpression("trunc", _("Truncation"), _("Troncate a number"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("Expression"));

    extension.AddExpression("lerp", _("Lerp (Linear interpolation)"), _("Linearly interpolate a to b by x"), _("Mathematical tools"), "res/mathfunction.png")
        .AddParameter("expression", _("a (in a+(b-a)*x)"))
        .AddParameter("expression", _("b (in a+(b-a)*x)"))
        .AddParameter("expression", _("x (in a+(b-a)*x)"));

    #endif
}
Exemple #12
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsKeyboardExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinKeyboard",
                          _("Keyboard features"),
                          _("Built-in extension allowing to use keyboard"),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)
    extension.AddCondition("KeyPressed",
                   _("Key pressed"),
                   _("Test if a key is pressed"),
                   _("_PARAM1_ key is pressed"),
                   _("Keyboard"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("key", _("Key"));

    extension.AddCondition("KeyReleased",
                   _("Key released"),
                   _("Test if a key was just released"),
                   _("_PARAM1_ key is released"),
                   _("Keyboard"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("key", _("Key"));

    extension.AddCondition("KeyFromTextPressed",
                   _("Key pressed (text expression)"),
                   _("Test if a key, retrieved from the result of the expression, is pressed"),
                   _("_PARAM1_ key is pressed"),
                   _("Keyboard"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Expression generating the key to test"))
        .MarkAsAdvanced();

    extension.AddCondition("KeyFromTextReleased",
                   _("Key released (text expression)"),
                   _("Test if a key, retrieved from the result of the expression, was just released"),
                   _("_PARAM1_ key is released"),
                   _("Keyboard"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Expression generating the key to test"))
        .MarkAsAdvanced();

    extension.AddCondition("AnyKeyPressed",
                   _("Any key pressed"),
                   _("Test if any key is pressed"),
                   _("Any key is pressed"),
                   _("Keyboard"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "");

    extension.AddStrExpression("LastPressedKey",
                       _("Last pressed key"),
                       _("Get the name of the latest key pressed on the keyboard"),
                       _("Keyboard"),
                       "res/conditions/keyboard.png")
        .AddCodeOnlyParameter("currentScene", "");
    #endif
}
Exemple #13
0
void DeclareTextObjectExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("TextObject",
                          _("Text object"),
                          _("Extension allowing to use an object displaying a text."),
                          "Florian Rival",
                          "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject("Text",
               _("Text"),
               _("Displays a text"),
               "CppPlatform/Extensions/texticon.png",
               &CreateTextObject);

    #if defined(GD_IDE_ONLY)
    obj.SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("String",
                   _("Modify the text"),
                   _("Modify the text of a Text object."),
                   _("Do _PARAM1__PARAM2_ to the text of _PARAM0_"),
                   "",
                   "res/actions/text24.png",
                   "res/actions/text.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("string", _("Text"))
        .SetFunctionName("SetString").SetManipulatedType("string").SetGetter("GetString").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("String",
                   _("Compare the text"),
                   _("Compare the text of a Text object."),
                   _("Text of _PARAM0_ is _PARAM1__PARAM2_"),
                   "",
                   "res/conditions/text24.png",
                   "res/conditions/text.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("string", _("Text to test"))
        .SetFunctionName("GetString").SetManipulatedType("string").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("Font",
                   _("Font"),
                   _("Modify the font of the text."),
                   _("Change font of _PARAM0_ to _PARAM1_"),
                   _("Font"),
                   "res/actions/font24.png",
                   "res/actions/font.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("police", _("Font"))
        .SetFunctionName("ChangeFont").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("Size",
                   _("Size"),
                   _("Modify the size of the text."),
                   _("Do _PARAM1__PARAM2_ to the size of the text of _PARAM0_"),
                   "",
                   "res/actions/characterSize24.png",
                   "res/actions/characterSize.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetCharacterSize").SetManipulatedType("number").SetGetter("GetCharacterSize").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("Size",
                   _("Size"),
                   _("Test the size of the text"),
                   _("The size of the text of _PARAM0_ is _PARAM1__PARAM2_"),
                   "",
                   "res/conditions/characterSize24.png",
                   "res/conditions/characterSize.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Size to test"))
        .SetFunctionName("GetCharacterSize").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("ChangeColor",
                   _("Color"),
                   _("Change the color of the text. The color is white by default."),
                   _("Change color of _PARAM0_ to _PARAM1_"),
                   _("Effects"),
                   "res/actions/color24.png",
                   "res/actions/color.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("color", _("Color"))
        .SetFunctionName("SetColor").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("Opacity",
                   _("Opacity"),
                   _("Modify the opacity of a Text object."),
                   _("Do _PARAM1__PARAM2_ to the opacity of _PARAM0_"),
                   "",
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetOpacity").SetManipulatedType("number").SetGetter("GetOpacity").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("Opacity",
                   _("Opacity"),
                   _("Test the value of the opacity of a text object."),
                   _("The opacity of _PARAM0_ is _PARAM1__PARAM2_"),
                   "",
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("GetOpacity").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h");



    obj.AddAction("SetSmooth",
                   _("Smoothing"),
                   _("Activate or desactivate text smoothing."),
                   _("Smooth _PARAM0_: _PARAM1_"),
                   _("Style"),
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("yesorno", _("Smooth the text"))
        .SetFunctionName("SetSmooth").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("Smoothed",
                   _("Smoothing"),
                   _("Test if an object is smoothed"),
                   _("_PARAM0_ is smoothed"),
                   _("Style"),
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("IsSmoothed").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("SetBold",
                   _("Bold"),
                   _("De/activate bold"),
                   _("Set bold style of _PARAM0_ : _PARAM1_"),
                   _("Style"),
                   "res/actions/bold.png",
                   "res/actions/bold16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("yesorno", _("Set bold style"))
        .SetFunctionName("SetBold").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("IsBold",
                   _("Bold"),
                   _("Test if bold style is activated"),
                   _("_PARAM0_ bold style is set"),
                   _("Style"),
                   "res/conditions/bold.png",
                   "res/conditions/bold16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("IsBold").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("SetItalic",
                   _("Italic"),
                   _("De/activate italic."),
                   _("Set italic style for _PARAM0_ : _PARAM1_"),
                   _("Style"),
                   "res/actions/italic.png",
                   "res/actions/italic16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("yesorno", _("Set italic"))
        .SetFunctionName("SetItalic").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("IsItalic",
                   _("Italic"),
                   _("Test if the italic style is activated"),
                   _("_PARAM0_ italic style is set"),
                   _("Style"),
                   "res/conditions/italic.png",
                   "res/conditions/italic16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("IsItalic").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("SetUnderlined",
                   _("Underlined"),
                   _("De/activate underlined style."),
                   _("Set underlined style of _PARAM0_: _PARAM1_"),
                   _("Style"),
                   "res/actions/underline.png",
                   "res/actions/underline16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("yesorno", _("Underline"))
        .SetFunctionName("SetUnderlined").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("IsUnderlined",
                   _("Underlined"),
                   _("Test if the underlined style of an object is set."),
                   _("_PARAM0_ underlined style is activated"),
                   _("Style"),
                   "res/conditions/underline.png",
                   "res/conditions/underline16.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("IsUnderlined").SetIncludeFile("TextObject/TextObject.h");

    obj.AddAction("Angle",
                   _("Angle"),
                   _("Modify the angle of a Text object."),
                   _("Do _PARAM1__PARAM2_ to the angle of _PARAM0_"),
                   _("Rotation"),
                   "res/actions/rotate24.png",
                   "res/actions/rotate.png")
        .SetHidden() //Deprecated, now available for all objects
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetAngle").SetManipulatedType("number").SetGetter("GetAngle").SetIncludeFile("TextObject/TextObject.h");

    obj.AddCondition("Angle",
                   _("Angle"),
                   _("Test the value of the angle of a text object."),
                   _("The angle of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Rotation"),
                   "res/conditions/rotate24.png",
                   "res/conditions/rotate.png")
        .SetHidden() //Deprecated, now available for all objects
        .AddParameter("object", _("Object"), "Text", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("GetAngle").SetManipulatedType("number").SetIncludeFile("TextObject/TextObject.h");

    obj.AddExpression("Opacity", _("Opacity"), _("Opacity"), _("Opacity"), "res/actions/opacity.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("GetOpacity").SetIncludeFile("TextObject/TextObject.h");

    obj.AddExpression("Angle", _("Angle"), _("Angle"), _("Rotation"), "res/actions/rotate.png")
        .SetHidden() //Deprecated, now available for all objects
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("GetAngle").SetIncludeFile("TextObject/TextObject.h");

    obj.AddStrExpression("String", _("Text"), _("Text"), _("Text"), "res/texteicon.png")
        .AddParameter("object", _("Object"), "Text", false)
        .SetFunctionName("GetString").SetIncludeFile("TextObject/TextObject.h");
    #endif
}
Exemple #14
0
void DeclareTileMapObjectExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("TileMapObject",
                              _("Tile Map Object"),
                              _("Extension allowing to use tile map objects."),
                              "Victor Levasseur and Florian Rival",
                              "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject("TileMap",
               _("Tile Map"),
               _("Displays a tile map"),
               "CppPlatform/Extensions/TileMapIcon.png",
               &CreateTileMapObject);

    #if defined(GD_IDE_ONLY)
    obj.SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddCondition("Width",
                   _("Width"),
                   _("Test the width of a Tile Map Object."),
                   _("The width of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size"),
                   "res/conditions/scaleWidth24.png",
                   "res/conditions/scaleWidth.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetFunctionName("GetWidth").SetManipulatedType("number").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddCondition("Height",
                   _("Height"),
                   _("Test the height of a Tile Map Object."),
                   _("The height of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size"),
                   "res/conditions/scaleHeight24.png",
                   "res/conditions/scaleHeight.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetFunctionName("GetHeight").SetManipulatedType("number").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddAction("SetMapSize",
                   _("Resize the tilemap"),
                   _("Change the size of the tilemap (number of tiles)."),
                   _("Resize the tilemap to _PARAM1_x_PARAM2_ tiles"),
                   _("Size"),
                   "CppPlatform/Extensions/TileMapIcon24.png",
                   "res/TileMapIcon16.png")
        .AddParameter("objectList", _("Tile Map Object"), "TileMap", false)
        .AddParameter("expression", _("Width (tiles count)"))
        .AddParameter("expression", _("Height (tiles count)"))
        .MarkAsSimple()
        .SetFunctionName("SetMapSize").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    extension.AddCondition("SingleTileCollision",
                   _("Collision with one tile"),
                   _("Test if an object collides a specific tile."),
                   _("_PARAM4_ is in collision with the tile at _PARAM2_;_PARAM3_ (layer _PARAM1_) of _PARAM0_"),
                   _("Collisions"),
                   "res/conditions/collision24.png",
                   "res/conditions/collision.png")
        .AddParameter("objectList", _("Tile Map Object"), "TileMap", false)
        .AddParameter("expression", _("Tile layer (0: Back, 1: Middle, 2: Top)"))
        .AddParameter("expression", _("Tile column"))
        .AddParameter("expression", _("Tile row"))
        .AddParameter("objectList", _("Object"))
        .AddCodeOnlyParameter("conditionInverted", "")
        .MarkAsSimple()
        .SetFunctionName("SingleTileCollision").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");



    obj.AddExpression("TileWidth", _("Tile width"), _("Tile width"), _("Tiles"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .SetFunctionName("GetTileWidth").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddExpression("TileHeight", _("Tile height"), _("Tile height"), _("Tiles"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .SetFunctionName("GetTileHeight").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddExpression("MapWidth", _("Map width (tiles)"), _("Map width"), _("Map"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .SetFunctionName("GetMapWidth").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddExpression("MapHeight", _("Map height (tiles)"), _("Map height"), _("Map"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .SetFunctionName("GetMapHeight").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");



    obj.AddExpression("GetTile", _("Get the Tile (id)"), _("Get the Tile (id)"), _("Map"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .AddParameter("expression", _("Layer"), "", false)
        .AddParameter("expression", _("Column"), "", false)
        .AddParameter("expression", _("Row"), "", false)
        .SetFunctionName("GetTile").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddAction("SetTile",
                   _("Change a tile"),
                   _("Change a tile at a specific cell."),
                   _("Set tile #_PARAM4_ at the cell _PARAM2_;_PARAM3_ (layer: _PARAM1_) in _PARAM0_"),
                   _("Tiles"),
                   "CppPlatform/Extensions/TileMapIcon24.png",
                   "res/TileMapIcon16.png")
        .AddParameter("objectList", _("Tile Map Object"), "TileMap", false)
        .AddParameter("expression", _("Tile layer (0: Back, 1: Middle, 2: Top)"))
        .AddParameter("expression", _("Tile column"))
        .AddParameter("expression", _("Tile row"))
        .AddParameter("expression", _("New tile Id (-1 to delete the tile)"))
        .MarkAsSimple()
        .SetFunctionName("SetTile").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");



    obj.AddExpression("GetColumnAt", _("Get tile column from X coordinates"), _("Get tile column from X coordinates"), _("Map"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .AddParameter("expression", _("X"), "", false)
        .SetFunctionName("GetColumnAt").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddExpression("GetRowAt", _("Get tile row from Y coordinates"), _("Get tile row from Y coordinates"), _("Map"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .AddParameter("expression", _("Y"), "", false)
        .SetFunctionName("GetRowAt").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");



    obj.AddStrExpression("SaveTiles", _("Save the tile map"), _("Save the tile map content in a string"), _("Saving"), "res/TileMapIcon16.png")
        .AddParameter("object", _("Object"), "TileMap", false)
        .SetFunctionName("SaveAsString").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    obj.AddAction("LoadTiles",
                   _("Load the tiles from a string"),
                   _("Load the tiles from a string."),
                   _("Load the tiles of _PARAM0_ from _PARAM1_"),
                   _("Loading"),
                   "CppPlatform/Extensions/TileMapIcon24.png",
                   "res/TileMapIcon16.png")
        .AddParameter("objectList", _("Tile Map Object"), "TileMap", false)
        .AddParameter("string", _("The string representing the tiles"))
        .MarkAsSimple()
        .SetFunctionName("LoadFromString").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");



    obj.AddAction("ChangeTexture",
                   _("Change the tileset texture"),
                   _("Change the tileset texture."),
                   _("Change the tileset texture of _PARAM0_ to _PARAM1_"),
                   _("Tileset"),
                   "CppPlatform/Extensions/TileMapIcon24.png",
                   "res/TileMapIcon16.png")
        .AddParameter("objectList", _("Tile Map Object"), "TileMap", false)
        .AddParameter("string", _("The new texture name"))
        .AddCodeOnlyParameter("currentScene", "")
        .MarkAsSimple()
        .SetFunctionName("ChangeTexture").SetIncludeFile("TileMapObject/RuntimeTileMapObject.h");

    #endif
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinStringInstructions",
                          _("Text manipulation"),
                          _("Built-in extension providing expressions for manipulating texts."),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)
    extension.AddStrExpression("NewLine",
                   _("Insert a new line"),
                   _("Insert a new line"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png");

    extension.AddStrExpression("SubStr",
                   _("Get a portion of a text"),
                   _("Get a portion of a text"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("expression", _("Start position of the portion ( The first letter is at position 0 )"), "",false)
        .AddParameter("expression", _("Length of the portion"), "",false);

    extension.AddStrExpression("StrAt",
                   _("Get a character from a text"),
                   _("Get a character from a text"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("expression", _("Position of the character ( The first letter is at position 0 )"), "",false);

    extension.AddExpression("StrLength",
                   _("Length of a text"),
                   _("Length of a text"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false);



    extension.AddExpression("StrFind",
                   _("Search in a text"),
                   _("Search in a text ( Return the position of the result or -1 if not found )"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("string", _("Text to search for"), "",false);



    extension.AddExpression("StrRFind",
                   _("Search in a text from end"),
                   _("Search in a text from the end ( Return the position of the result or -1 if not found )"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("string", _("Text to search for"), "",false);



    extension.AddExpression("StrFindFrom",
                   _("Search in a text, starting from a position"),
                   _("Search in a text starting from a position ( Return the position of the result or -1 if not found )"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("string", _("Text to search for"), "",false)
        .AddParameter("expression", _("Position of the first character in the string to be considered in the search"), "",false);



    extension.AddExpression("StrRFindFrom",
                   _("Search in a text from the end, starting from a position"),
                   _("Search in a text from the end, starting from a position ( Return the position of the result or -1 if not found )"),
                   _("Manipulation on text"),
                   "res/conditions/toujours24.png")

        .AddParameter("string", _("Text"), "",false)
        .AddParameter("string", _("Text to search for"), "",false)
        .AddParameter("expression", _("Position of the last character in the string to be considered in the search"), "",false);


    #endif
}
Exemple #16
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinVariables",
                                      _("Variable features"),
                                      _("Built-in extension allowing to manipulate variables"),
                                      "Florian Rival",
                                      "Freeware");

#if defined(GD_IDE_ONLY)
    extension.AddCondition("VarScene",
                           _("Value of a variable"),
                           _("Compare the value of a scene variable."),
                           _("Variable _PARAM0_ is _PARAM1__PARAM2_"),
                           _("Variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("relationalOperator", _("Sign of the test"))
    .AddParameter("expression", _("Value to compare"))
    .SetManipulatedType("number");

    extension.AddCondition("VarSceneTxt",
                           _("Text of a variable"),
                           _("Compare the text of a scene variable."),
                           _("The text of variable _PARAM0_ is _PARAM1__PARAM2_"),
                           _("Variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("relationalOperator", _("Sign of the test"))
    .AddParameter("string", _("Text to compare"))
    .SetManipulatedType("string");

    extension.AddCondition("VariableChildExists",
                           _("Child existence"),
                           _("Return true if the specified child of the variable exists."),
                           _("Child _PARAM1_ of variable _PARAM0_ exists"),
                           _("Variables/Structures"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("string", _("Name of the child"));

    extension.AddCondition("GlobalVariableChildExists",
                           _("Child existence"),
                           _("Return true if the specified child of the global variable exists."),
                           _("Child _PARAM1_ of global variable _PARAM0_ exists"),
                           _("Variables/Global variables/Structures"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("string", _("Name of the child"));

    extension.AddCondition("VarSceneDef",
                           _("Test if a scene variable is defined"),
                           _("Test if the scene variable exist."),
                           _("Variable _PARAM0_ is defined"),
                           _("Variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddCodeOnlyParameter("currentScene", "")
    .AddParameter("string", _("Variable"))
    .SetHidden();

    extension.AddCondition("VarGlobal",
                           _("Value of a global variable"),
                           _("Compare the value of a global variable."),
                           _("Global variable _PARAM0_ is _PARAM1__PARAM2_"),
                           _("Variables/Global variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("relationalOperator", _("Sign of the test"))
    .AddParameter("expression", _("Value to compare"))
    .SetManipulatedType("number");

    extension.AddCondition("VarGlobalTxt",
                           _("Text of a global variable"),
                           _("Compare the text of a global variable."),
                           _("The text of the global variable _PARAM0_ is _PARAM1__PARAM2_"),
                           _("Variables/Global variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("relationalOperator", _("Sign of the test"))
    .AddParameter("string", _("Text to compare"))
    .SetManipulatedType("string");

    extension.AddCondition("VarGlobalDef",
                           _("Test if a global variable is defined"),
                           _("Test if a global variable exists"),
                           _("Global variable _PARAM0_ is defined"),
                           _("Variables/Global variables"),
                           "res/conditions/var24.png",
                           "res/conditions/var.png")
    .AddCodeOnlyParameter("currentScene", "")
    .AddParameter("string", _("Variable"))
    .SetHidden();


    extension.AddAction("ModVarScene",
                        _("Value of a variable"),
                        _("Modify the value of a scene variable."),
                        _("Do _PARAM1__PARAM2_ to variable _PARAM0_"),
                        _("Variables"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("operator", _("Modification's sign"))
    .AddParameter("expression", _("Value"))
    .SetManipulatedType("number");

    extension.AddAction("ModVarSceneTxt",
                        _("String of a variable"),
                        _("Modify the text of a scene variable."),
                        _("Do _PARAM1__PARAM2_ to the text of variable _PARAM0_"),
                        _("Variables"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("operator", _("Modification's sign"))
    .AddParameter("string", _("Text"))
    .SetManipulatedType("string");

    extension.AddAction("ModVarGlobal",
                        _("Value of a global variable"),
                        _("Modify the value of a global variable"),
                        _("Do _PARAM1__PARAM2_ to global variable _PARAM0_"),
                        _("Variables/Global variables"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("operator", _("Modification's sign"))
    .AddParameter("expression", _("Value"))
    .SetManipulatedType("number");

    extension.AddAction("ModVarGlobalTxt",
                        _("String of a global variable"),
                        _("Modify the text of a global variable."),
                        _("Do _PARAM1__PARAM2_ to the text of global variable _PARAM0_"),
                        _("Variables/Global variables"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("operator", _("Modification's sign"))
    .AddParameter("string", _("Text"))
    .SetManipulatedType("string");

    extension.AddAction("VariableRemoveChild",
                        _("Remove a child"),
                        _("Remove a child from a variable."),
                        _("Remove child _PARAM1_ from variable _PARAM0_"),
                        _("Variables/Structure"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("scenevar", _("Variable"))
    .AddParameter("string", _("Child's name"));

    extension.AddAction("GlobalVariableRemoveChild",
                        _("Remove a child"),
                        _("Remove a child from a global variable."),
                        _("Remove child _PARAM1_ from global variable _PARAM0_"),
                        _("Variables/Global variables/Structure"),
                        "res/actions/var24.png",
                        "res/actions/var.png")
    .AddParameter("globalvar", _("Variable"))
    .AddParameter("string", _("Child's name"));

    extension.AddExpression("Variable", _("Scene variables"), _("Scene variables"), _("Variables"), "res/actions/var.png")
    .AddParameter("scenevar", _("Variable"));

    extension.AddStrExpression("VariableString", _("Scene variables"), _("Text of a scene variable"), _("Variables"), "res/actions/var.png")
    .AddParameter("scenevar", _("Variable"));

    extension.AddExpression("GlobalVariable", _("Global variables"), _("Global variable"), _("Variables"), "res/actions/var.png")
    .AddParameter("globalvar", _("Name of the global variable"));

    extension.AddStrExpression("GlobalVariableString", _("Global variables"), _("Text of a global variable"), _("Variables"), "res/actions/var.png")
    .AddParameter("globalvar", _("Variable"));
#endif
}
Exemple #17
0
void DeclarePanelSpriteObjectExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("PanelSpriteObject",
        _("Panel Sprite (9-patch) Object"),
        _("Extension allowing to use panel sprite (\"9-patch\") objects."),
        "Victor Levasseur and Florian Rival",
        "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject("PanelSprite",
        _("Panel Sprite (\"9-patch\")"),
        _("An image with edges and corners that are stretched separately from the fill."),
        "CppPlatform/Extensions/PanelSpriteIcon.png",
        &CreatePanelSpriteObject);

    #if defined(GD_IDE_ONLY)
    obj.SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");

    obj.AddAction("Width",
                   _("Width"),
                   _("Modify the width of a Panel Sprite."),
                   _("Do _PARAM1__PARAM2_ to the width of _PARAM0_"),
                   _("Size and angle"),
                   "res/actions/scaleWidth24.png",
                   "res/actions/scaleWidth.png")
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetWidth").SetManipulatedType("number").SetGetter("GetWidth").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");

    obj.AddCondition("Width",
                   _("Width"),
                   _("Test the width of a Panel Sprite."),
                   _("The width of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size and angle"),
                   "res/conditions/scaleWidth24.png",
                   "res/conditions/scaleWidth.png")
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("GetWidth").SetManipulatedType("number").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");


    obj.AddAction("Height",
                   _("Height"),
                   _("Modify the height of a Panel Sprite."),
                   _("Do _PARAM1__PARAM2_ to the height of _PARAM0_"),
                   _("Size and angle"),
                   "res/actions/scaleHeight24.png",
                   "res/actions/scaleHeight.png")
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetHeight").SetManipulatedType("number").SetGetter("GetHeight").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");


    obj.AddCondition("Height",
                   _("Height"),
                   _("Test the height of a Panel Sprite."),
                   _("The height of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size and angle"),
                   "res/conditions/scaleHeight24.png",
                   "res/conditions/scaleHeight.png")
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("SetHeight").SetManipulatedType("number").SetGetter("GetHeight").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");


    obj.AddAction("Angle",
                   _("Angle"),
                   _("Modify the angle of a Panel Sprite."),
                   _("Do _PARAM1__PARAM2_ to the angle of _PARAM0_"),
                   _("Size and angle"),
                   "res/actions/rotate24.png",
                   "res/actions/rotate.png")
        .SetHidden() //Deprecated, now available for all objects
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetAngle").SetManipulatedType("number").SetGetter("GetAngle").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");

    obj.AddCondition("Angle",
                   _("Angle"),
                   _("Test the angle of a Panel Sprite."),
                   _("The angle of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size and angle"),
                   "res/conditions/rotate24.png",
                   "res/conditions/rotate.png")
        .SetHidden() //Deprecated, now available for all objects
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("SetAngle").SetManipulatedType("number").SetGetter("GetAngle").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");


    obj.AddAction("Image",
                   _("Image name"),
                   _("Change the image of a Panel Sprite."),
                   _("Set image _PARAM1_ on _PARAM0_"),
                   _("Image"),
                   "res/imageicon24.png",
                   "res/imageicon.png")
        .AddParameter("object", _("Object"), "PanelSprite", false)
        .AddParameter("string", _("Image name"))
        .AddCodeOnlyParameter("currentScene", "0")
        .SetFunctionName("ChangeAndReloadImage").SetIncludeFile("PanelSpriteObject/PanelSpriteObject.h");
    #endif
}
Exemple #18
0
void DeclareTopDownMovementBehaviorExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("TopDownMovementBehavior",
                              _("Top-down movement"),
                              _("Move objects in 4 or 8 directions"),
                              "Florian Rival",
                              "Open source (MIT License)");

    gd::BehaviorMetadata & aut = extension.AddBehavior("TopDownMovementBehavior",
          _("Top-down movement (4 or 8 directions)"),
          "TopDownMovement",
          _("The object can be moved left, up, right, down and optionally diagonals."),
          "",
          "CppPlatform/Extensions/topdownmovementicon.png",
          "TopDownMovementBehavior",
          std::shared_ptr<gd::Behavior>(new TopDownMovementBehavior),
          std::shared_ptr<gd::BehaviorsSharedData>(new gd::BehaviorsSharedData));

    #if defined(GD_IDE_ONLY)

    aut.SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("SimulateLeftKey",
                   _("Simulate left key press"),
                   _("Simulate a pressing on left key."),
                   _("Simulate pressing Left for _PARAM0_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("SimulateLeftKey").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("SimulateRightKey",
                   _("Simulate right key press"),
                   _("Simulate a pressing on right key."),
                   _("Simulate pressing Right for _PARAM0_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("SimulateRightKey").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("SimulateUpKey",
                   _("Simulate up key press"),
                   _("Simulate a pressing on up key ( Used when on a ladder )."),
                   _("Simulate pressing Up for _PARAM0_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("SimulateUpKey").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("SimulateDownKey",
                   _("Simulate down key press"),
                   _("Simulate a pressing on down key ( Used when on a ladder )."),
                   _("Simulate pressing Down for _PARAM0_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("SimulateDownKey").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("SimulateControl",
                   _("Simulate control"),
                   _("Simulate a pressing on a key.\nValid keys are Left, Right, Up, Down."),
                   _("Simulate pressing _PARAM2_ key for _PARAM0_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("string", _("Key"))
        .MarkAsAdvanced()
        .SetFunctionName("SimulateControl").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("IgnoreDefaultControls",
                   _("Ignore default controls"),
                   _("De/activate the use of default controls.\nIf deactivated, use the simulate actions to move the object."),
                   _("Ignore default controls for _PARAM0_: _PARAM2_"),
                   _("Controls"),
                   "res/conditions/keyboard24.png",
                   "res/conditions/keyboard.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("yesorno", _("Ignore controls"))
        .MarkAsAdvanced()
        .SetFunctionName("IgnoreDefaultControls").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("IsMoving",
                   _("Is moving"),
                   _("Check if the object is moving."),
                   _("_PARAM0_ is moving"),
                   _(""),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("IsMoving").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("Acceleration",
                   _("Acceleration"),
                   _("Change the acceleration of the object"),
                   _("Do _PARAM2__PARAM3_ to the acceleration of _PARAM0_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetAcceleration").SetGetter("GetAcceleration").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("Acceleration",
                   _("Acceleration"),
                   _("Compare the acceleration of the object"),
                   _("Acceleration of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("GetAcceleration").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("Deceleration",
                   _("Deceleration"),
                   _("Change the deceleration of the object"),
                   _("Do _PARAM2__PARAM3_ to the deceleration of _PARAM0_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetDeceleration").SetGetter("GetDeceleration").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("Deceleration",
                   _("Deceleration"),
                   _("Compare the deceleration of the object"),
                   _("Deceleration of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("GetDeceleration").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("MaxSpeed",
                   _("Maximum speed"),
                   _("Change the maximum speed of the object"),
                   _("Do _PARAM2__PARAM3_ to the max. speed of _PARAM0_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetMaxSpeed").SetGetter("GetMaxSpeed").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("MaxSpeed",
                   _("Maximum speed"),
                   _("Compare the maximum speed of the object"),
                   _("Max. speed of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("GetMaxSpeed").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("Speed",
                   _("Speed"),
                   _("Compare the speed of the object"),
                   _("Speed of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("GetSpeed").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("AngularMaxSpeed",
                   _("Angular maximum speed"),
                   _("Change the maximum angular speed of the object"),
                   _("Do _PARAM2__PARAM3_ to the max. angular speed of _PARAM0_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetAngularMaxSpeed").SetGetter("GetAngularMaxSpeed").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("AngularMaxSpeed",
                   _("Angular maximum speed"),
                   _("Compare the maximum angular speed of the object"),
                   _("Max. angular speed of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("GetAngularMaxSpeed").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("AngleOffset",
                   _("Rotation offset"),
                   _("Change the rotation offset applied when moving the object"),
                   _("Do _PARAM2__PARAM3_ to the rotation offset of _PARAM0_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("SetAngleOffset").SetGetter("GetAngleOffset").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("AngleOffset",
                   _("Rotation offset"),
                   _("Compare the rotation offset applied when moving the object"),
                   _("Rotation offset of _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetFunctionName("GetAngleOffset").SetManipulatedType("number").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("AllowDiagonals",
                   _("Diagonals moves"),
                   _("Allow or restrict diagonal moves"),
                   _("Allow diagonal moves for _PARAM0_: _PARAM2_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("yesorno", _("Allow?"))
        .SetFunctionName("SetAllowDiagonals").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("DiagonalsAllowed",
                   _("Diagonals moves"),
                   _("Return true if the object is allowed to do diagonal moves"),
                   _("Size of the extra border applied to _PARAM0_ is _PARAM2__PARAM3_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("DiagonalsAllowed").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddAction("RotateObject",
                   _("Rotate the object"),
                   _("Enable or disable rotation of the object"),
                   _("Enable rotation of _PARAM0_: _PARAM2_"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .AddParameter("yesorno", _("Rotate object?"))
        .MarkAsAdvanced()
        .SetFunctionName("SetRotateObject").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddCondition("ObjectRotated",
                   _("Object rotated"),
                   _("Return true if the object is rotated when traveling on its path."),
                   _("_PARAM0_ is rotated when moving"),
                   _("Movement"),
                   "CppPlatform/Extensions/topdownmovementicon24.png",
                   "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .MarkAsAdvanced()
        .SetFunctionName("IsObjectRotated").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");


    aut.AddExpression("Acceleration", _("Acceleration"), _("Acceleration of the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetAcceleration").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddExpression("Deceleration", _("Deceleration"), _("Deceleration of the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetDeceleration").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddExpression("MaxSpeed", _("Maximum speed"), _("Maximum speed of the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetMaxSpeed").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddExpression("Speed", _("Speed"), _("Speed of the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetSpeed").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddExpression("AngularMaxSpeed", _("Angular maximum speed"), _("Angular maximum speed of the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetAngularMaxSpeed").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");

    aut.AddExpression("AngleOffset", _("Rotation offset"), _("Rotation offset applied to the object"), _("Movement"), "CppPlatform/Extensions/topdownmovementicon16.png")
        .AddParameter("object", _("Object"))
        .AddParameter("behavior", _("Behavior"), "TopDownMovementBehavior")
        .SetFunctionName("GetAngleOffset").SetIncludeFile("TopDownMovementBehavior/TopDownMovementBehavior.h");
    #endif
}
Exemple #19
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinCamera",
                          _("Cameras and layers features"),
                          _("Builtin camera extension"),
                          "Florian Rival",
                          "Freeware");

    #if defined(GD_IDE_ONLY)
    extension.AddCondition("CameraX",
                   _("Camera center X position"),
                   _("Compare the X position of a the center of a camera."),
                   _("X position of camera _PARAM4_ is _PARAM1__PARAM2_ ( Layer: _PARAM3_ )"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("relationalOperator", _("Sign of the test"), "",false)
        .AddParameter("expression", _("Value to test"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0")
        .SetManipulatedType("number");



    extension.AddCondition("CameraY",
                   _("Camera center Y position"),
                   _("Compare the Y position of a the center of a camera."),
                   _("The Y position of camera _PARAM4_ is _PARAM1__PARAM2_  ( Layer: _PARAM3_ )"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("relationalOperator", _("Sign of the test"), "",false)
        .AddParameter("expression", _("Value to test"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0")
        .SetManipulatedType("number");



    extension.AddAction("CameraX",
                   _("Camera center X position"),
                   _("Change X position of the center of the specified camera."),
                   _("Do _PARAM1__PARAM2_ to X position of camera _PARAM4_ ( Layer: _PARAM3_ )"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("operator", _("Modification's sign"), "",false)
        .AddParameter("expression", _("Value"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0")
        .SetManipulatedType("number");

    extension.AddAction("CameraY",
                   _("Camera center Y position"),
                   _("Change Y position of the center of the specified camera."),
                   _("Do _PARAM1__PARAM2_ to Y position of camera _PARAM4_ ( Layer: _PARAM3_ )"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("operator", _("Modification's sign"), "",false)
        .AddParameter("expression", _("Value"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0")
        .SetManipulatedType("number");

    extension.AddCondition("CameraWidth",
                   _("Width of a camera"),
                   _("Test the width of a camera of a layer"),
                   _("The width of camera _PARAM2_ of layer _PARAM1_ is _PARAM3__PARAM4_"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number"), "",false)
        .AddParameter("relationalOperator", _("Sign of the test"), "",false)
        .AddParameter("expression", _("Value to test"), "",false)
        .SetManipulatedType("number");



    extension.AddCondition("CameraHeight",
                   _("Height of a camera"),
                   _("Test the height of a camera of a layer"),
                   _("The height of camera _PARAM2_ of layer _PARAM1_ is _PARAM3__PARAM4_"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number"), "",false)
        .AddParameter("relationalOperator", _("Sign of the test"), "",false)
        .AddParameter("expression", _("Value to test"), "",false)
        .SetManipulatedType("number");



    extension.AddCondition("CameraAngle",
                   _("Angle of a camera of a layer"),
                   _("Test a camera angle."),
                   _("Angle of camera is _PARAM1__PARAM2_ ( layer : _PARAM3_, camera : _PARAM4_ )"),
                   _("Layers and cameras"),
                   "res/conditions/camera24.png",
                   "res/conditions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("relationalOperator", _("Sign of the test"), "",false)
        .AddParameter("expression", _("Value to test"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0")
        .SetManipulatedType("number");



    extension.AddAction("RotateCamera",
                   _("Change camera angle"),
                   _("This action modify the angle of a camera of the specified layer."),
                   _("Do _PARAM1__PARAM2_ to angle of camera ( layer : _PARAM3_, camera : _PARAM4_ )"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("operator", _("Modification's sign"), "",false)
        .AddParameter("expression", _("Value"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0")
        .SetManipulatedType("number");

    extension.AddAction("AddCamera",
                   _("Add a camera to a layer"),
                   _("This action add a camera to a layer"),
                   _("Add a camera to layer _PARAM1_"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Width"), "",true)
        .AddParameter("expression", _("Height"), "",true)
        .AddParameter("expression", _("Render zone: Top left side: X Position ( Between 0 and 1 )"), "",true)
        .AddParameter("expression", _("Render zone: Top left side: Y Position ( Between 0 and 1 )"), "",true)
        .AddParameter("expression", _("Render zone: Bottom right side: X Position ( Between 0 and 1 )"), "",true)
        .AddParameter("expression", _("Render zone: Bottom right side: Y Position ( Between 0 and 1 )"), "",true);

    extension.AddAction("DeleteCamera",
                   _("Delete a camera of a layer"),
                   _("Remove the specified camera from a layer"),
                   _("Delete camera _PARAM2_ from layer _PARAM1_"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number"), "",false);

    extension.AddAction("CameraSize",
                   _("Modify the size of a camera"),
                   _("This action modify the size of a camera of the specified layer. The zoom will be reset."),
                   _("Change the size of camera _PARAM2_ of _PARAM1_ to _PARAM3_*_PARAM4_"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number"), "",false)
        .AddParameter("expression", _("Width"), "",false)
        .AddParameter("expression", _("Height"), "",false);

    extension.AddAction("CameraViewport",
                   _("Modify the render zone of a camera"),
                   _("This action modify the render zone of a camera of the specified layer."),
                   _("Set the render zone of camera _PARAM2_ from layer _PARAM1_ to PARAM3_;_PARAM4_ _PARAM5_;_PARAM6_"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number"), "",false)
        .AddParameter("expression", _("Render zone: Top left side: X Position ( Between 0 and 1 )"), "",false)
        .AddParameter("expression", _("Render zone: Top left side: X Position ( Between 0 and 1 )"), "",false)
        .AddParameter("expression", _("Render zone: Bottom right side: X Position ( Between 0 and 1 )"), "",false)
        .AddParameter("expression", _("Render zone: Bottom right side: X Position ( Between 0 and 1 )"), "",false);

    extension.AddAction("ZoomCamera",
                   _("Change camera zoom."),
                   _("Change camera zoom."),
                   _("Change camera zoom to _PARAM1_ ( layer : _PARAM2_, camera : _PARAM3_ )"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Value ( 1:Initial zoom, 2:Zoom x2, 0.5:Unzoom x2...)"), "",false)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");

    extension.AddAction("FixCamera",
                   _("Center the camera on an object within limits"),
                   _("Center the camera on the specified object, without leaving the specified limits."),
                   _("Center the camera on _PARAM1_ ( limit : from _PARAM2_;_PARAM3_ to _PARAM4_;_PARAM5_ )  ( layer : _PARAM7_, camera : _PARAM8_ )"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("objectPtr", _("Object"))
        .AddParameter("expression", _("Top left side of the boundary: X Position"), "",false)
        .AddParameter("expression", _("Top left side of the boundary: Y Position"), "",false)
        .AddParameter("expression", _("Bottom right side of the boundary: X Position"), "",false)
        .AddParameter("expression", _("Bottom right side of the boundary: Y Position"), "",false)
        .AddParameter("yesorno", _("Anticipating the displacement of the object (yes by default)"), "",true).SetDefaultValue("true")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");

    extension.AddAction("CentreCamera",
                   _("Center the camera on an object"),
                   _("Center the camera on the specified object."),
                   _("Center camera on _PARAM1_ ( layer : _PARAM3_, camera : _PARAM4_ )"),
                   _("Layers and cameras"),
                   "res/actions/camera24.png",
                   "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("objectPtr", _("Object"))
        .AddParameter("yesorno", _("Anticipating the displacement of the object (yes by default)"), "",true).SetDefaultValue("true")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");

    extension.AddAction("ShowLayer",
                   _("Show a layer"),
                   _("Show a layer."),
                   _("Show layer _PARAM1_"),
                   _("Layers and cameras"),
                   "res/actions/layer24.png",
                   "res/actions/layer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"");

    extension.AddAction("HideLayer",
                   _("Hide a layer"),
                   _("Hide a layer."),
                   _("Hide layer _PARAM1_"),
                   _("Layers and cameras"),
                   "res/actions/layer24.png",
                   "res/actions/layer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"");

    extension.AddCondition("LayerVisible",
                   _("Visibility of a layer"),
                   _("Test if a layer is displayed"),
                   _("Layer _PARAM1_ is visible"),
                   _("Layers and cameras"),
                   "res/conditions/layer24.png",
                   "res/conditions/layer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",false).SetDefaultValue("\"\"");



    extension.AddExpression("CameraWidth", _("Width of a camera of a layer"), _("Width of a camera of a layer"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraHeight", _("Height of a camera of a layer"), _("Height of a camera of a layer"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraViewportLeft", _("X position of the top left side point of a render zone"), _("X position of the top left side point of a render zone"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraViewportTop", _("Y position of the top left side point of a render zone"), _("Y position of the top left side point of a render zone"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraViewportRight", _("X position of the bottom right side point of a render zone"), _("X position of the bottom right side point of a render zone"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraViewportBottom", _("Y position of the bottom right side point of a render zone"), _("Y position of the bottom right side point of a render zone"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",false)
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",false).SetDefaultValue("0");


    extension.AddExpression("CameraX", _("Camera X position"), _("Camera X position"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");


    extension.AddExpression("VueX", _("Camera X position"), _("Camera X position"), _("Camera"), "res/actions/camera.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");


    extension.AddExpression("CameraY", _("Camera Y position"), _("Camera Y position"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");


    extension.AddExpression("VueY", _("Camera Y position"), _("Camera Y position"), _("Camera"), "res/actions/camera.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");


    extension.AddExpression("CameraRotation", _("Angle of a camera of a layer"), _("Angle of a camera of a layer"), _("Camera"), "res/actions/camera.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");


    extension.AddExpression("VueRotation", _("Angle of a camera of a layer"), _("Angle of a camera of a layer"), _("Camera"), "res/actions/camera.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("layer", _("Layer"), "",true).SetDefaultValue("\"\"")
        .AddParameter("expression", _("Camera number ( default : 0 )"), "",true).SetDefaultValue("0");

    #endif
}
void GD_CORE_API
BuiltinExtensionsImplementer::ImplementsStringInstructionsExtension(
    gd::PlatformExtension& extension) {
  extension
      .SetExtensionInformation(
          "BuiltinStringInstructions",
          _("Text manipulation"),
          _("Built-in extension providing expressions for manipulating text "
            "objects."),
          "Florian Rival",
          "Open source (MIT License)")
      .SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);

#if defined(GD_IDE_ONLY)
  extension.AddStrExpression("NewLine",
                             _("Insert a new line"),
                             _("Insert a new line"),
                             _("Manipulation of text"),
                             "res/conditions/toujours24.png");

  extension
      .AddStrExpression("FromCodePoint",
                        _("Get character from code point"),
                        _("Get character from code point"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("expression", _("Code point"));

  extension
      .AddStrExpression("ToUpperCase",
                        _("Uppercase a text"),
                        _("Uppercase a text"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"));

  extension
      .AddStrExpression("ToLowerCase",
                        _("Lowercase a text"),
                        _("Lowercase a text"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"));

  extension
      .AddStrExpression("SubStr",
                        _("Get a portion of a text"),
                        _("Get a portion of a text"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter("expression",
                    _("Start position of the portion (the first letter is at "
                      "position 0)"))
      .AddParameter("expression", _("Length of the portion"));

  extension
      .AddStrExpression("StrAt",
                        _("Get a character from a text"),
                        _("Get a character from a text"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter(
          "expression",
          _("Position of the character (the first letter is at position 0)"));

  extension
      .AddStrExpression("StrRepeat",
                        _("Repeat a text"),
                        _("Repeat a text"),
                        _("Manipulation of text"),
                        "res/conditions/toujours24.png")

      .AddParameter("string", _("Text to repeat"))
      .AddParameter("expression", _("Repetition count"));

  extension
      .AddExpression("StrLength",
                     _("Length of a text"),
                     _("Length of a text"),
                     _("Manipulation of text"),
                     "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"));

  extension
      .AddExpression("StrFind",
                     _("Search in a text"),
                     _("Search in a text (return the position of the result or "
                       "-1 if not found)"),
                     _("Manipulation of text"),
                     "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter("string", _("Text to search for"));

  extension
      .AddExpression("StrRFind",
                     _("Search in a text from the end"),
                     _("Search in a text from the end (return the position of "
                       "the result or -1 if not found)"),
                     _("Manipulation of text"),
                     "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter("string", _("Text to search for"));

  extension
      .AddExpression("StrFindFrom",
                     _("Search in a text, starting from a position"),
                     _("Search in a text, starting from a position (return the "
                       "position of the result or -1 if not found)"),
                     _("Manipulation of text"),
                     "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter("string", _("Text to search for"))
      .AddParameter("expression",
                    _("Position of the first character in the string to be "
                      "considered in the search"));

  extension
      .AddExpression(
          "StrRFindFrom",
          _("Search in a text from the end, starting from a position"),
          _("Search in a text from the end, starting from a position (return "
            "the position of the result or -1 if not found)"),
          _("Manipulation of text"),
          "res/conditions/toujours24.png")

      .AddParameter("string", _("Text"))
      .AddParameter("string", _("Text to search for"))
      .AddParameter("expression",
                    _("Position of the last character in the string to be "
                      "considered in the search"));

#endif
}
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("Sprite",
                          _("Sprite"),
                          _("Extension for adding animated objects in the scene, which can contain animations with directions within each."),
                          "Florian Rival",
                          "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject("Sprite",
               _("Sprite"),
               _("Animated object which can be used for most elements of a game"),
               "CppPlatform/Extensions/spriteicon.png",
               &CreateSpriteObject);

    #if defined(GD_IDE_ONLY)
    obj.AddAction("Opacity",
                   _("Change object's opacity"),
                   _("Change the opacity of an object."),
                   _("Do _PARAM1__PARAM2_ to the opacity of _PARAM0_"),
                   _("Visibility"),
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsSimple()
        .SetManipulatedType("number");

    obj.AddAction("ChangeAnimation",
                   _("Change the animation"),
                   _("Modify the current animation of the object."),
                   _("Do _PARAM1__PARAM2_ to the number of current animation of _PARAM0_"),
                   _("Animations and images"),
                   "res/actions/animation24.png",
                   "res/actions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsSimple()
        .SetManipulatedType("number");

    obj.AddAction("ChangeDirection",
                   _("Change the direction"),
                   _("Change the direction of the object.\nIf the object is set to automatically rotate, the direction is its angle.\nIf the object is in 8 directions mode, the valid directions are 0..7"),
                   _("Do _PARAM1__PARAM2_ to the direction of _PARAM0_"),
                   _("Direction"),
                   "res/actions/direction24.png",
                   "res/actions/direction.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");


    obj.AddAction("ChangeSprite",
                   _("Current frame"),
                   _("Modify the current frame of the object"),
                   _("Do _PARAM1__PARAM2_ to animation frame of _PARAM0_"),
                   _("Animations and images"),
                   "res/actions/sprite24.png",
                   "res/actions/sprite.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddAction("PauseAnimation",
                   _("Pause the animation"),
                   _("Pause the current animation of the object"),
                   _("Pause the current animation of _PARAM0_"),
                   _("Animations and images"),
                   "res/actions/animation24.png",
                   "res/actions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .MarkAsSimple();


    obj.AddAction("PlayAnimation",
                   _("Play the animation"),
                   _("Play the current animation of the object"),
                   _("Play the current animation of _PARAM0_"),
                   _("Animations and images"),
                   "res/actions/animation24.png",
                   "res/actions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .MarkAsSimple();

    obj.AddAction("ChangeAnimationSpeedScale",
                   _("Animation speed scale"),
                   _("Modify the animation speed scale (1 = the default speed, >1 = faster and <1 = slower)."),
                   _("Do _PARAM1__PARAM2_ to the animation speed scale of _PARAM0_"),
                   _("Animations and images"),
                   "res/actions/animation24.png",
                   "res/actions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsSimple()
        .SetManipulatedType("number");

    obj.AddAction("TourneVersPos",
                   _("Rotate an object toward a position"),
                   _("Rotate an object towards a position."),
                   _("Rotate _PARAM0_ towards _PARAM1_;_PARAM2_"),
                   _("Direction"),
                   "res/actions/direction24.png",
                   "res/actions/direction.png")

        .AddParameter("object", _("Object to be rotated"), "Sprite")
        .AddParameter("expression", _("X position"))
        .AddParameter("expression", _("Y position"))
        .AddParameter("expression", _("Angular speed (degrees per second)")).SetDefaultValue("0")
        .AddCodeOnlyParameter("currentScene", "")
        .SetHidden(); //Deprecated


    obj.AddAction("ChangeScale",
                   _("Scale"),
                   _("Modify the scale of the specified object."),
                   _("Do _PARAM1__PARAM2_ to the scale of _PARAM0_"),
                   _("Size"),
                   "res/actions/scale24.png",
                   "res/actions/scale.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced();


    obj.AddAction("ChangeScaleWidth",
                   _("Scale on X axis"),
                   _("Modify the scale of the width of an object."),
                   _("Do _PARAM1__PARAM2_ to the width's scale of _PARAM0_"),
                   _("Size"),
                   "res/actions/scale24.png",
                   "res/actions/scale.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");


    obj.AddAction("ChangeScaleHeight",
                   _("Scale on Y axis"),
                   _("Modify the scale of the height of an object."),
                   _("Do _PARAM1__PARAM2_ to the height's scale of _PARAM0_"),
                   _("Size"),
                   "res/actions/scale24.png",
                   "res/actions/scale.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");


    obj.AddCondition("Animation",
                   _("Current animation"),
                   _("Test the number of the current animation of the object."),
                   _("The number of the current animation of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Animations and images"),
                   "res/conditions/animation24.png",
                   "res/conditions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Number to test"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddCondition("Direction",
                   _("Current direction"),
                   _("Compare the direction of the object. If 8 direction mode is activated for the sprite, the value taken for direction will be from 0 to 7. Otherwise, the direction is in degrees."),
                   _("Direction of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Direction"),
                   "res/conditions/direction24.png",
                   "res/conditions/direction.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Direction to test"))
        .SetManipulatedType("number");

    obj.AddCondition("Sprite",
                   _("Current frame"),
                   _("Test the number of the current animation frame."),
                   _("The animation frame of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Animations and images"),
                   "res/conditions/sprite24.png",
                   "res/conditions/sprite.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Animation frame to test"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddCondition("AnimStopped",
                   _("Animation paused"),
                   _("Test if the animation of an object is paused"),
                   _("The animation of _PARAM0_ is paused"),
                   _("Animations and images"),
                   "res/conditions/animation24.png",
                   "res/conditions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .MarkAsSimple();

    obj.AddCondition("AnimationEnded",
                   _("Animation finished"),
                   _("Check if the animation being played by the Sprite object is finished."),
                   _("The animation of _PARAM0_ is finished"),
                   _("Animations and images"),
                   "res/conditions/animation24.png",
                   "res/conditions/animation.png")

        .AddParameter("object", _("Object"), "Sprite")
        .MarkAsSimple();

    obj.AddCondition("ScaleWidth",
                   _("Scale on X axis"),
                   _("Compare the scale of the width of an object."),
                   _("The width's scale of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size"),
                   "res/conditions/scaleWidth24.png",
                   "res/conditions/scaleWidth.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddCondition("ScaleHeight",
                   _("Scale on Y axis"),
                   _("Compare the scale of the height of an object."),
                   _("The height's scale of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Size"),
                   "res/conditions/scaleHeight24.png",
                   "res/conditions/scaleHeight.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddCondition("Opacity",
                   _("Opacity"),
                   _("Compare the opacity of an object, between 0 (fully transparent) to 255 (opaque)"),
                   _("The opacity of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Visibility"),
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsSimple()
        .SetManipulatedType("number");

    obj.AddCondition("BlendMode",
                   _("Blend mode"),
                   _("Compare the number of the blend mode currently used by an object"),
                   _("The number of the current blend mode of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Effects"),
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test (0: Alpha, 1: Add, 2: Multiply, 3: None)"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    obj.AddAction("CopyImageOnImageOfSprite",
                   _("Copy an image on the current one of an object"),
                   _("Copy an image on the current image of an object.\nNote that the source image must be preferably kept loaded in memory."),
                   _("Copy image _PARAM2_ on the current of _PARAM0_ at _PARAM3_;_PARAM4_"),
                   _("Effects"),
                   "res/copy24.png",
                   "res/copyicon.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Name of the source image"))
        .AddParameter("expression", _("X position"))
        .AddParameter("expression", _("Y position"))
        .AddParameter("yesorno", _("Should the copy take in account the source transparency\?"));

    obj.AddAction("CreateMaskFromColorOnActualImage", //Actual is indeed a mistake : Current should have been chosen.
                   _("Make a color of the image of an object transparent"),
                   _("Make a color of the image of an object transparent."),
                   _("Make color _PARAM1_ of the current image of _PARAM0_ transparent"),
                   _("Effects"),
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("color", _("Color to make transparent"));


    obj.AddAction("ChangeColor",
                   _("Global color"),
                   _("Change the global color of an object. The default color is white."),
                   _("Change color of _PARAM0_ to _PARAM1_"),
                   _("Effects"),
                   "res/actions/color24.png",
                   "res/actions/color.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("color", _("Color"));


    obj.AddAction("ChangeBlendMode",
                   _("Blend mode"),
                   _("Change the number of the blend mode of an object.\nThe default blend mode is 0 (Alpha)."),
                   _("Change Blend mode of _PARAM0_ to _PARAM1_"),
                   _("Effects"),
                   "res/actions/color24.png",
                   "res/actions/color.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("expression", _("Mode (0 : Alpha, 1 : Add, 2 : Multiply, 3 : None)"))
        .MarkAsSimple();


    obj.AddAction("FlipX",
                   _("Flip the object horizontally"),
                   _("Flip the object horizontally"),
                   _("Flip horizontally _PARAM0_ : _PARAM1_"),
                   _("Effects"),
                   "res/actions/flipX24.png",
                   "res/actions/flipX.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("yesorno", _("Activate flipping"))
        .MarkAsSimple();


    obj.AddAction("FlipY",
                   _("Flip the object vertically"),
                   _("Flip the object vertically"),
                   _("Flip vertically _PARAM0_ : _PARAM1_"),
                   _("Effects"),
                   "res/actions/flipY24.png",
                   "res/actions/flipY.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("yesorno", _("Activate flipping"))
        .MarkAsSimple();

    obj.AddCondition("FlippedX",
                   _("Horizontally flipped"),
                   _("Return true if the object is horizontally flipped"),
                   _("_PARAM0_ is horizontally flipped"),
                   _("Effects"),
                   "res/actions/flipX24.png",
                   "res/actions/flipX.png")

        .AddParameter("object", _("Object"), "Sprite");

    obj.AddCondition("FlippedY",
                   _("Vertically flipped"),
                   _("Return true if the object is vertically flipped"),
                   _("_PARAM0_ is vertically flipped"),
                   _("Effects"),
                   "res/actions/flipY24.png",
                   "res/actions/flipY.png")

        .AddParameter("object", _("Object"), "Sprite");

    obj.AddAction("TourneVers",
                   _("Rotate an object toward another"),
                   _("Rotate an object towards another."),
                   _("Rotate _PARAM0_ towards _PARAM1_"),
                   _("Direction"),
                   "res/actions/direction24.png",
                   "res/actions/direction.png")

        .AddParameter("object", _("Object to be rotated"), "Sprite")
        .AddParameter("objectPtr", _("Rotate toward this object"))
        .AddCodeOnlyParameter("currentScene", "")
        .SetHidden(); //Deprecated

    obj.AddExpression("X", _("X position of a point"), _("X position of a point"), _("Position"), "res/actions/position.png")
        .SetHidden()
        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("", _("Name of the point"), "", true);

    obj.AddExpression("Y", _("Y position of a point"), _("Y position of a point"), _("Position"), "res/actions/position.png")
        .SetHidden()
        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("", _("Name of the point"), "", true);

    obj.AddExpression("PointX", _("X position of a point"), _("X position of a point"), _("Position"), "res/actions/position.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("", _("Name of the point"));

    obj.AddExpression("PointY", _("Y position of a point"), _("Y position of a point"), _("Position"), "res/actions/position.png")

        .AddParameter("object", _("Object"), "Sprite")
        .AddParameter("", _("Name of the point"));

    obj.AddExpression("Direc", _("Direction"), _("Direction of the object"), _("Direction"), "res/actions/direction.png")
        .SetHidden()
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("Direction", _("Direction"), _("Direction of the object"), _("Direction"), "res/actions/direction.png")
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("Anim", _("Animation"), _("Animation of the object"), _("Animations and images"), "res/actions/animation.png")
        .SetHidden()
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("Animation", _("Animation"), _("Animation of the object"), _("Animations and images"), "res/actions/animation.png")
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("Sprite", _("Image"), _("Animation frame of the object"), _("Animations and images"), "res/actions/sprite.png")
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("AnimationSpeedScale", _("Animation speed scale"), _("Animation speed scale"), _("Animations and images"), "res/actions/animation.png")
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("ScaleX", _("Scale of the width of an object"), _("Scale of the width of an object"), _("Size"), "res/actions/scaleWidth.png")
        .AddParameter("object", _("Object"), "Sprite");

    obj.AddExpression("ScaleY", _("Scale of the height of an object"), _("Scale of the height of an object"), _("Size"), "res/actions/scaleHeight.png")
        .AddParameter("object", _("Object"), "Sprite");

    extension.AddCondition("Collision",
                      _("Collision (Pixel perfect)"),
                      _("The condition is true if there is a collision between the two objects.\nThe test is pixel-perfect."),
                      _("_PARAM0_ is in collision with _PARAM1_ (pixel perfect)"),
                      _("Collision"),
                      "res/conditions/collision24.png",
                      "res/conditions/collision.png")
        .AddParameter("objectList", _("Object 1"), "Sprite")
        .AddParameter("objectList", _("Object 2"), "Sprite")
        .AddCodeOnlyParameter("conditionInverted", "");
    #endif
}
Exemple #22
0
void DeclarePrimitiveDrawingExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("PrimitiveDrawing",
                  _("Primitive drawing"),
                  _("Extension allowing to draw shapes and manipulate images."),
                  "Florian Rival",
                  "Open source (MIT License)");

    gd::ObjectMetadata & obj = extension.AddObject("Drawer", //"Drawer" is kept for compatibility with GD<=3.6.76
               _("Shape painter"),
               _("Allows to draw simple shapes on the screen"),
               "CppPlatform/Extensions/primitivedrawingicon.png",
               &CreateShapePainterObject);

    #if defined(GD_IDE_ONLY)
    ShapePainterObject::LoadEdittimeIcon();
    obj.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");

    obj.AddAction("Rectangle",
                   _("Rectangle"),
                   _("Draw a rectangle on screen"),
                   _("Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a rectangle with _PARAM0_"),
                   _("Drawing"),
                   "res/actions/rectangle24.png",
                   "res/actions/rectangle.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("expression", _("Top left side: X Position"))
        .AddParameter("expression", _("Top left side : Y Position"))
        .AddParameter("expression", _("Bottom right side : X Position"))
        .AddParameter("expression", _("Bottom right side : Y Position"))
        .SetFunctionName("DrawRectangle").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("Circle",
                   _("Circle"),
                   _("Draw a circle on screen"),
                   _("Draw at _PARAM1_;_PARAM2_ a circle of radius _PARAM3_ with _PARAM0_"),
                   _("Drawing"),
                   "res/actions/circle24.png",
                   "res/actions/circle.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("expression", _("X position of center"))
        .AddParameter("expression", _("Y position of center"))
        .AddParameter("expression", _("Radius ( in pixels )"))
        .SetFunctionName("DrawCircle").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("Line",
                   _("Line"),
                   _("Draw a line  on screen"),
                   _("Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a line (thickness  : _PARAM5_) with _PARAM0_"),
                   _("Drawing"),
                   "res/actions/line24.png",
                   "res/actions/line.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("expression", _("X Position of start point"))
        .AddParameter("expression", _("Y Position of start point"))
        .AddParameter("expression", _("X Position of end point"))
        .AddParameter("expression", _("Y Position of end point"))
        .AddParameter("expression", _("Thickness ( in pixels )"))
        .SetFunctionName("DrawLine").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("FillColor",
                   _("Fill color"),
                   _("Change the color of filling"),
                   _("Change fill color of _PARAM0_ to _PARAM1_"),
                   _("Setup"),
                   "res/actions/text24.png",
                   "res/actions/text.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("color", _("Fill color"))
        .SetFunctionName("SetFillColor").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("OutlineColor",
                   _("Outline color"),
                   _("Modify the color of the outline of future drawings."),
                   _("Change outline color of _PARAM0_ to _PARAM1_"),
                   _("Setup"),
                   "res/actions/color24.png",
                   "res/actions/color.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("color", _("Color"))
        .SetFunctionName("SetOutlineColor").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("OutlineSize",
                   _("Outline size"),
                   _("Modify the size of the outline of future drawings."),
                   _("Do _PARAM1__PARAM2_ to the size of the outline of _PARAM0_"),
                   _("Setup"),
                   "res/actions/outlineSize24.png",
                   "res/actions/outlineSize.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Size in pixels"))
        .SetFunctionName("SetOutlineSize").SetManipulatedType("number").SetGetter("GetOutlineSize").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddCondition("OutlineSize",
                   _("Outline size"),
                   _("Test the size of the outline."),
                   _("The size of the outline of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Setup"),
                   "res/conditions/outlineSize24.png",
                   "res/conditions/outlineSize.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Size to test"))
        .SetFunctionName("GetOutlineSize").SetManipulatedType("number").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("FillOpacity",
                   _("Fill opacity"),
                   _("Modify the opacity of filling of future drawings."),
                   _("Do _PARAM1__PARAM2_ to the opacity of filling of _PARAM0_"),
                   _("Setup"),
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetFillOpacity").SetManipulatedType("number").SetGetter("GetFillOpacity").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");



    obj.AddCondition("FillOpacity",
                   _("Fill opacity"),
                   _("Test the value of the opacity of the filling."),
                   _("The opacity of filling of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Setup"),
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("GetFillOpacity").SetManipulatedType("number").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddAction("OutlineOpacity",
                   _("Outline opacity"),
                   _("Modify the opacity of the outline of future drawings."),
                   _("Do _PARAM1__PARAM2_ to the opacity of the outline of _PARAM0_"),
                   _("Setup"),
                   "res/actions/opacity24.png",
                   "res/actions/opacity.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("operator", _("Modification's sign"))
        .AddParameter("expression", _("Value"))
        .SetFunctionName("SetOutlineOpacity").SetManipulatedType("number").SetGetter("GetOutlineOpacity").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");


    obj.AddCondition("OutlineOpacity",
                   _("Outline opacity"),
                   _("Test the opacity of the outline."),
                   _("The opacity of the outline of _PARAM0_ is _PARAM1__PARAM2_"),
                   _("Setup"),
                   "res/conditions/opacity24.png",
                   "res/conditions/opacity.png")

        .AddParameter("object", _("Shape Painter object"), "Drawer")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .SetFunctionName("GetOutlineOpacity").SetManipulatedType("number").SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");

    #endif
}
Exemple #23
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinTime",
                          _("Time"),
                          _("Built-in extension providing actions and conditions about the time."),
                          "Florian Rival",
                          "Open source (MIT License)");

    #if defined(GD_IDE_ONLY)

    extension.AddCondition("Timer",
                   _("Value of a timer"),
                   _("Test the elapsed time of a timer."),
                   _("The timer _PARAM2_ is greater than _PARAM1_ seconds"),
                   _("Timers and time"),
                   "res/conditions/timer24.png",
                   "res/conditions/timer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Time in seconds"))
        .AddParameter("string", _("Timer's name"));

    extension.AddCondition("TimeScale",
                   _("Time scale"),
                   _("Test the time scale."),
                   _("The time scale is _PARAM1__PARAM2_"),
                   _("Timers and time"),
                   "res/conditions/time24.png",
                   "res/conditions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("relationalOperator", _("Sign of the test"))
        .AddParameter("expression", _("Value to test"))
        .MarkAsAdvanced()
        .SetManipulatedType("number");

    extension.AddCondition("TimerPaused",
                   _("State of a timer"),
                   _("Test if specified timer is paused."),
                   _("The timer _PARAM1_ is paused"),
                   _("Timers and time"),
                   "res/conditions/timerPaused24.png",
                   "res/conditions/timerPaused.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"))
        .MarkAsAdvanced();

    extension.AddAction("ResetTimer",
                   _("Reset a timer"),
                   _("Reset the specified timer."),
                   _("Reset the timer _PARAM1_"),
                   _("Timers and time"),
                   "res/actions/timer24.png",
                   "res/actions/timer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"));

    extension.AddAction("PauseTimer",
                   _("Pause a timer"),
                   _("Pause a timer."),
                   _("Pause timer _PARAM1_"),
                   _("Timers and time"),
                   "res/actions/pauseTimer24.png",
                   "res/actions/pauseTimer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"))
        .MarkAsAdvanced();

    extension.AddAction("UnPauseTimer",
                   _("Unpause a timer"),
                   _("Unpause a timer."),
                   _("Unpause timer _PARAM1_"),
                   _("Timers and time"),
                   "res/actions/unPauseTimer24.png",
                   "res/actions/unPauseTimer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"))
        .MarkAsAdvanced();

    extension.AddAction("RemoveTimer",
                   _("Delete a timer"),
                   _("Delete a timer from memory."),
                   _("Delete timer _PARAM1_ from memory"),
                   _("Timers and time"),
                   "res/actions/timer24.png",
                   "res/actions/timer.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"))
        .MarkAsAdvanced();

    extension.AddAction("ChangeTimeScale",
                   _("Change time scale"),
                   _("Change the time scale of the game."),
                   _("Set time scale to _PARAM1_"),
                   _("Timers and time"),
                   "res/actions/time24.png",
                   "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Scale (1 : Default, 2 : Faster, 0.5 : Slower...)"));

    extension.AddExpression("TimeDelta", _("Time elapsed since the last image"), _("Time elapsed since the last image"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "");

    extension.AddExpression("TempsFrame", _("Time elapsed since the last image"), _("Time elapsed since the last image"), _("Time"), "res/actions/time.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "");

    extension.AddExpression("ElapsedTime", _("Time elapsed since the last image"), _("Time elapsed since the last image"), _("Time"), "res/actions/time.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "");


    extension.AddExpression("TimerElapsedTime", _("Timer value"), _("Value of a timer"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Timer's name"));


    extension.AddExpression("TimeFromStart", _("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
;

    extension.AddExpression("TempsDebut", _("Time elapsed since the beginning of the scene"), _("Time elapsed since the beginning of the scene"), _("Time"), "res/actions/time.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "")
;


    extension.AddExpression("TimeScale", _("Time scale"), _("Time scale"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
;

    extension.AddExpression("TimeScale", _("Time scale"), _("Time scale"), _("Time"), "res/actions/time.png")
        .SetHidden()
        .AddCodeOnlyParameter("currentScene", "");


    extension.AddExpression("Time", _("Current time"), _("Current time"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("", _("Hour : hour\nMinutes : min\nSeconds : sec\nDay in the month : mday\nMonths since January : mon\nYear since 1900 : year\nDays since sunday :wday\nDays since January 1st : yday"));

    #endif
}
Exemple #24
0
void GD_CORE_API BuiltinExtensionsImplementer::ImplementsWindowExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinWindow",
                          _("Window features"),
                          _("Built-in extension allowing to manipulate the game's window"),
                          "Florian Rival",
                          "Freeware");

    #if defined(GD_IDE_ONLY)
    extension.AddAction("EcrireTexte",
                   _("Display a text"),
                   _("Display the specified text to screen"),
                   _("Display _PARAM1_ at _PARAM2_;_PARAM3_ ( color  : _PARAM4_ , size : _PARAM5_, font : _PARAM6_ )"),
                   _("Scene"),
                   "res/actions/texte24.png",
                   "res/actions/texte.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Text"), "",false)
        .AddParameter("expression", _("X position"), "",false)
        .AddParameter("expression", _("Y position"), "",false)
        .AddParameter("color", _("Color"), "",false)
        .AddParameter("expression", _("Size"), "",false)
        .AddParameter("police", _("Font"), "",true)
        .AddParameter("layer", _("Layer ( Base layer if empty )"), "",true).SetDefaultValue("\"\"");

    extension.AddAction("SetFullScreen",
                   _("De/activate fullscreen"),
                   _("This action activate or desactivate fullscreen."),
                   _("Activate fullscreen:  _PARAM1_ (Keep aspect ratio: _PARAM2_)"),
                   _("Game's window"),
                   "res/actions/fullscreen24.png",
                   "res/actions/fullscreen.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("yesorno", _("Activate fullscreen"), "",false)
        .AddParameter("yesorno", _("Keep aspect ratio (HTML5 games only, yes by default)"), "",true).SetDefaultValue("yes");

    extension.AddAction("SetWindowMargins",
                   _("Change window's margins"),
                   _("This action change the margins, in pixels, of the game's window."),
                   _("Set margins of game window to _PARAM1_;_PARAM2_;_PARAM3_;_PARAM4_"),
                   _("Game's window"),
                   "res/actions/window24.png",
                   "res/actions/window.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Top"), "",false)
        .AddParameter("expression", _("Right"), "",false)
        .AddParameter("expression", _("Bottom"), "",false)
        .AddParameter("expression", _("Left"), "",false);

    extension.AddAction("SetWindowSize",
                   _("Change the size of the screen"),
                   _("This action change the size of the game window."),
                   _("Change window size : _PARAM1_x_PARAM2_"),
                   _("Game's window"),
                   "res/actions/window24.png",
                   "res/actions/window.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("expression", _("Width"), "",false)
        .AddParameter("expression", _("Height"), "",false)
        .AddParameter("yesorno", _("Use this size as default size for new scene cameras\?\n(Yes to change extend the game area, No to stretch the game to the window's size)."), "",false);

    extension.AddAction("SetWindowIcon",
                   _("Change window's icon"),
                   _("This action change the icon of the game's window."),
                   _("Use _PARAM1_ as icon for the game's window."),
                   _("Game's window"),
                   "res/actions/window24.png",
                   "res/actions/window.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("Name of the image to be used as the icon"), "",false);

    extension.AddAction("SetWindowTitle",
                   _("Change window's title"),
                   _("This action change the title of the game window."),
                   _("Change window title to _PARAM1_"),
                   _("Game's window"),
                   "res/actions/window24.png",
                   "res/actions/window.png")
        .AddCodeOnlyParameter("currentScene", "")
        .AddParameter("string", _("New title"), "",false);

    extension.AddExpression("SceneWindowWidth", _("Width of the scene's window"), _("Width of the scene's window"), _("Screen"), "res/window.png")
        .AddCodeOnlyParameter("currentScene", "");

    extension.AddExpression("SceneWindowHeight", _("Height of the scene's window"), _("Height of the scene's window"), _("Screen"), "res/window.png")
        .AddCodeOnlyParameter("currentScene", "");


    extension.AddExpression("ScreenWidth", _("Width of the current resolution"), _("Width of the current resolution"), _("Screen"), "res/display16.png");

    extension.AddExpression("ScreenHeight", _("Height of the current resolution"), _("Height of the current resolution"), _("Screen"), "res/display16.png");

    extension.AddExpression("ColorDepth", _("Color depth"), _("Color depth"), _("Screen"), "res/display16.png");

    extension.AddStrExpression("WindowTitle", _("Window's title"), _("Window's title"), _("Screen"), "res/window.png")
        .AddCodeOnlyParameter("currentScene", "");
    #endif
}