本文整理汇总了C++中gd::PlatformExtension::AddCondition方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformExtension::AddCondition方法的具体用法?C++ PlatformExtension::AddCondition怎么用?C++ PlatformExtension::AddCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gd::PlatformExtension
的用法示例。
在下文中一共展示了PlatformExtension::AddCondition方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例2: ImplementsSpriteExtension
//.........这里部分代码省略.........
.MarkAsAdvanced();
obj.AddAction("ChangeScaleWidth",
_("Scale on X axis"),
_("Modify the scale of the width of an object."),
_("Do _PARAM1__PARAM2_ to the width's scale of _PARAM0_"),
_("Size"),
"res/actions/scale24.png",
"res/actions/scale.png")
.AddParameter("object", _("Object"), "Sprite")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddAction("ChangeScaleHeight",
_("Scale on Y axis"),
_("Modify the scale of the height of an object."),
_("Do _PARAM1__PARAM2_ to the height's scale of _PARAM0_"),
_("Size"),
"res/actions/scale24.png",
"res/actions/scale.png")
.AddParameter("object", _("Object"), "Sprite")
.AddParameter("operator", _("Modification's sign"))
.AddParameter("expression", _("Value"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddCondition("Animation",
_("Current animation"),
_("Test the number of the current animation of the object."),
_("The number of the current animation of _PARAM0_ is _PARAM1__PARAM2_"),
_("Animations and images"),
"res/conditions/animation24.png",
"res/conditions/animation.png")
.AddParameter("object", _("Object"), "Sprite")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Number to test"))
.MarkAsAdvanced()
.SetManipulatedType("number");
obj.AddCondition("Direction",
_("Current direction"),
_("Compare the direction of the object. If 8 direction mode is activated for the sprite, the value taken for direction will be from 0 to 7. Otherwise, the direction is in degrees."),
_("Direction of _PARAM0_ is _PARAM1__PARAM2_"),
_("Direction"),
"res/conditions/direction24.png",
"res/conditions/direction.png")
.AddParameter("object", _("Object"), "Sprite")
.AddParameter("relationalOperator", _("Sign of the test"))
.AddParameter("expression", _("Direction to test"))
.SetManipulatedType("number");
obj.AddCondition("Sprite",
_("Current frame"),
_("Test the number of the current animation frame."),
_("The animation frame of _PARAM0_ is _PARAM1__PARAM2_"),
_("Animations and images"),
"res/conditions/sprite24.png",
示例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");
//.........这里部分代码省略.........
示例4: 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
}
示例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"))
//.........这里部分代码省略.........
示例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", "");
//.........这里部分代码省略.........
示例7: 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",
//.........这里部分代码省略.........
示例8: ImplementsVariablesExtension
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();
//.........这里部分代码省略.........
示例9: 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
}