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
}
Beispiel #2
0
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::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
}
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::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
}
Beispiel #6
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
}
Beispiel #7
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
}
Beispiel #8
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
}