当前位置: 首页>>代码示例>>C++>>正文


C++ gd::PlatformExtension类代码示例

本文整理汇总了C++中gd::PlatformExtension的典型用法代码示例。如果您正苦于以下问题:C++ PlatformExtension类的具体用法?C++ PlatformExtension怎么用?C++ PlatformExtension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PlatformExtension类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ImplementsJoystickExtension

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
}
开发者ID:HaoDrang,项目名称:GD,代码行数:58,代码来源:JoystickExtension.cpp

示例2: DeclareDestroyOutsideBehaviorExtension

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

}
开发者ID:HaoDrang,项目名称:GD,代码行数:53,代码来源:Extension.cpp

示例3: DeclareDestroyOutsideAutomatismExtension

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

}
开发者ID:darkhog,项目名称:GD,代码行数:50,代码来源:Extension.cpp

示例4: ImplementsExternalLayoutsExtension

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
}
开发者ID:darkhog,项目名称:GD,代码行数:22,代码来源:ExternalLayoutsExtension.cpp

示例5: ImplementsCommonConversionsExtension

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
}
开发者ID:Slulego,项目名称:GD,代码行数:47,代码来源:CommonConversionsExtension.cpp

示例6: ImplementsNetworkExtension

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
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:71,代码来源:NetworkExtension.cpp

示例7: DeclarePlatformAutomatismExtension

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"),
//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:GD,代码行数:101,代码来源:Extension.cpp

示例8: ImplementsSceneExtension

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"))
//.........这里部分代码省略.........
开发者ID:alcemirfernandes,项目名称:GD,代码行数:101,代码来源:SceneExtension.cpp

示例9: ImplementsCommonInstructionsExtension

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
}
开发者ID:trinajstica,项目名称:GD,代码行数:83,代码来源:CommonInstructionsExtension.cpp

示例10: DeclareAdMobObjectExtension

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");
}
开发者ID:trinajstica,项目名称:GD,代码行数:74,代码来源:Extension.cpp

示例11: ImplementsMathematicalToolsExtension

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")
//.........这里部分代码省略.........
开发者ID:alcemirfernandes,项目名称:GD,代码行数:101,代码来源:MathematicalToolsExtension.cpp

示例12: ImplementsKeyboardExtension

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
}
开发者ID:HaoDrang,项目名称:GD,代码行数:68,代码来源:KeyboardExtension.cpp

示例13: DeclareTextObjectExtension

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",
//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:GD,代码行数:101,代码来源:Extension.cpp

示例14: DeclareTileMapObjectExtension

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",
//.........这里部分代码省略.........
开发者ID:AntonioModer,项目名称:GD,代码行数:101,代码来源:Extension.cpp

示例15: ImplementsStringInstructionsExtension

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
}
开发者ID:AntonioModer,项目名称:GD,代码行数:91,代码来源:StringInstructionsExtension.cpp


注:本文中的gd::PlatformExtension类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。