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


C++ PlatformExtension::AddAction方法代码示例

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


在下文中一共展示了PlatformExtension::AddAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: ImplementsCameraExtension

void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(gd::PlatformExtension & extension)
{
    extension.SetExtensionInformation("BuiltinCamera",
                          _("Cameras and layers features"),
                          _("Builtin camera extension"),
                          "Florian Rival",
                          "Freeware");

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



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



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

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

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



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


//.........这里部分代码省略.........
开发者ID:darkhog,项目名称:GD,代码行数:101,代码来源:CameraExtension.cpp

示例4: 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

示例5: 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

示例6: ImplementsTimeExtension

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

    #if defined(GD_IDE_ONLY)

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

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

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

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

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

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

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

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

    extension.AddExpression("TimeDelta", _("Time elapsed since the last image"), _("Time elapsed since the last image"), _("Time"), "res/actions/time.png")
        .AddCodeOnlyParameter("currentScene", "");
//.........这里部分代码省略.........
开发者ID:alcemirfernandes,项目名称:GD,代码行数:101,代码来源:TimeExtension.cpp

示例7: ImplementsVariablesExtension


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

示例8: ImplementsWindowExtension

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


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