mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
2 Commits
v5.1.155
...
feature/im
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ffa7708a6d | ||
![]() |
2185c25e35 |
@@ -726,8 +726,6 @@ gd::String EventsCodeGenerator::GenerateParameterCodes(
|
||||
metadata.GetType() == "fontResource" ||
|
||||
metadata.GetType() == "imageResource" ||
|
||||
metadata.GetType() == "jsonResource" ||
|
||||
metadata.GetType() == "tilemapResource" ||
|
||||
metadata.GetType() == "tilesetResource" ||
|
||||
metadata.GetType() == "videoResource" ||
|
||||
// Deprecated, old parameter names:
|
||||
metadata.GetType() == "password" || metadata.GetType() == "musicfile" ||
|
||||
|
@@ -105,8 +105,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
|
||||
"res/function32.png",
|
||||
"res/function16.png")
|
||||
.AddParameter("functionParameterName", "Parameter name")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
extension
|
||||
.AddCondition(
|
||||
@@ -118,8 +117,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAdvancedExtension(
|
||||
"res/function32.png",
|
||||
"res/function16.png")
|
||||
.AddParameter("functionParameterName", "Parameter name")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("string");
|
||||
}
|
||||
|
||||
} // namespace gd
|
||||
|
@@ -146,83 +146,69 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
.AddAction("ModVolumeSoundCanal",
|
||||
_("Volume of the sound on a channel"),
|
||||
_("This action modifies the volume of the sound on the "
|
||||
"specified channel."),
|
||||
"specified channel. The volume is between 0 and 100."),
|
||||
_("the volume of the sound on channel _PARAM1_"),
|
||||
_("Sounds on channels"),
|
||||
"res/actions/sonVolume24.png",
|
||||
"res/actions/sonVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume (0-100)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
.AddAction("ModVolumeMusicCanal",
|
||||
_("Volume of the music on a channel"),
|
||||
_("This action modifies the volume of the music on the "
|
||||
"specified channel."),
|
||||
"specified channel. The volume is between 0 and 100."),
|
||||
_("the volume of the music on channel _PARAM1_"),
|
||||
_("Music on channels"),
|
||||
"res/actions/musicVolume24.png",
|
||||
"res/actions/musicVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume (0-100)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
.AddAction("ModGlobalVolume",
|
||||
_("Game global volume"),
|
||||
_("This action modifies the global volume of the game."),
|
||||
_("This action modifies the global volume of the game. The "
|
||||
"volume is between 0 and 100."),
|
||||
_("the global sound level"),
|
||||
"",
|
||||
"res/actions/volume24.png",
|
||||
"res/actions/volume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume (0-100)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
extension
|
||||
.AddAction("ModPitchSoundChannel",
|
||||
_("Pitch of the sound of a channel"),
|
||||
_("This action modifies the pitch (speed) of the sound on a "
|
||||
"channel."),
|
||||
"channel.\n1 is the default pitch."),
|
||||
_("the pitch of the sound on channel _PARAM1_"),
|
||||
_("Sounds on channels"),
|
||||
"res/actions/son24.png",
|
||||
"res/actions/son.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Pitch (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
.AddAction("ModPitchMusicChannel",
|
||||
_("Pitch of the music on a channel"),
|
||||
_("This action modifies the pitch of the music on the "
|
||||
"specified channel."),
|
||||
"specified channel. 1 is the default pitch"),
|
||||
_("the pitch of the music on channel _PARAM1_"),
|
||||
_("Music on channels"),
|
||||
"res/actions/music24.png",
|
||||
"res/actions/music.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Pitch (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -236,10 +222,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/actions/son.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Position (in seconds)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -253,10 +236,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/actions/music.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Position (in seconds)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -468,17 +448,15 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
.AddCondition(
|
||||
"SoundCanalVolume",
|
||||
_("Volume of the sound on a channel"),
|
||||
_("Test the volume of the sound on the specified channel."),
|
||||
_("Test the volume of the sound on the specified channel. The volume "
|
||||
"is between 0 and 100."),
|
||||
_("the volume of the sound on channel _PARAM1_"),
|
||||
_("Sounds on channels"),
|
||||
"res/conditions/sonVolume24.png",
|
||||
"res/conditions/sonVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume to compare to (0-100)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -493,10 +471,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/conditions/musicVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume to compare to (0-100)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -509,10 +484,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/conditions/volume24.png",
|
||||
"res/conditions/volume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Volume to compare to (0-100)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
extension
|
||||
.AddCondition(
|
||||
@@ -526,27 +498,22 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/conditions/sonVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Pitch to compare to (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
.AddCondition(
|
||||
"MusicChannelPitch",
|
||||
_("Pitch of the music on a channel"),
|
||||
_("Test the pitch (speed) of the music on a specified channel."),
|
||||
_("Test the pitch (speed) of the music on a specified channel. 1 is "
|
||||
"the default pitch."),
|
||||
_("the pitch of the music on channel _PARAM1_"),
|
||||
_("Music on channels"),
|
||||
"res/conditions/musicVolume24.png",
|
||||
"res/conditions/musicVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Pitch to compare to (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -560,10 +527,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/conditions/sonVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Position to compare to (in seconds)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -577,10 +541,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsAudioExtension(
|
||||
"res/conditions/musicVolume.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Channel identifier"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Position to compare to (in seconds)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
|
@@ -40,8 +40,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/position_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("MettreX",
|
||||
@@ -53,8 +52,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/actions/position_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddCondition("PosY",
|
||||
@@ -66,8 +64,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/position_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("MettreY",
|
||||
@@ -79,8 +76,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/actions/position_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("MettreXY",
|
||||
@@ -124,7 +120,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Center"),
|
||||
"res/actions/position24_black.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndConditionAndAction(
|
||||
"number",
|
||||
@@ -135,7 +131,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Center"),
|
||||
"res/actions/position24_black.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition("number",
|
||||
"BoundingBoxLeft",
|
||||
@@ -146,7 +142,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-left_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition(
|
||||
"number",
|
||||
@@ -157,7 +153,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-top_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition("number",
|
||||
"BoundingBoxRight",
|
||||
@@ -168,7 +164,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-right_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition("number",
|
||||
"BoundingBoxBottom",
|
||||
@@ -179,7 +175,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-bottom_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition("number",
|
||||
"BoundingBoxCenterX",
|
||||
@@ -190,7 +186,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-center_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddExpressionAndCondition("number",
|
||||
"BoundingBoxCenterY",
|
||||
@@ -201,7 +197,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
_("Position/Bounding Box"),
|
||||
"res/conditions/bounding-box-center_black.svg")
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
obj.AddAction("MettreAutourPos",
|
||||
_("Put around a position"),
|
||||
@@ -230,10 +226,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/actions/direction_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("Rotate",
|
||||
_("Rotate"),
|
||||
@@ -389,8 +382,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/actions/planicon.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ChangeLayer",
|
||||
_("Layer"),
|
||||
@@ -415,8 +407,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("objectvar", _("Variable"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ModVarObjetTxt",
|
||||
_("Text of an object variable"),
|
||||
@@ -428,8 +419,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("objectvar", _("Variable"))
|
||||
.UseStandardOperatorParameters("string",
|
||||
ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("string");
|
||||
|
||||
obj.AddAction("SetObjectVariableAsBoolean",
|
||||
_("Boolean value of an object variable"),
|
||||
@@ -526,10 +516,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/direction_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Plan",
|
||||
@@ -541,8 +528,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/planicon.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Layer",
|
||||
@@ -599,8 +585,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/vitesse.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("AngleOfDisplacement",
|
||||
@@ -628,8 +613,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("objectvar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("VarObjetTxt",
|
||||
_("Text of an object variable"),
|
||||
@@ -641,8 +625,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("objectvar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("string");
|
||||
|
||||
obj.AddCondition("ObjectVariableAsBoolean",
|
||||
_("Boolean value of an object variable"),
|
||||
@@ -1440,39 +1423,34 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"res/conditions/nbObjet24.png",
|
||||
"res/conditions/nbObjet.png")
|
||||
.AddParameter("objectList", _("Object"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsSimple()
|
||||
.SetHidden();
|
||||
|
||||
extension
|
||||
.AddExpressionAndCondition(
|
||||
"number",
|
||||
"SceneInstancesCount",
|
||||
_("Number of object instances on the scene"),
|
||||
_("the number of instances of the specified objects living on the "
|
||||
"scene"),
|
||||
_("the number of _PARAM1_ living on the scene"),
|
||||
_("Objects"),
|
||||
"res/conditions/nbObjet24.png")
|
||||
.AddCodeOnlyParameter("objectsContext", "")
|
||||
.AddParameter("objectListOrEmptyWithoutPicking", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.MarkAsSimple();
|
||||
extension.AddExpressionAndCondition(
|
||||
"number",
|
||||
"SceneInstancesCount",
|
||||
_("Number of object instances on the scene"),
|
||||
_("the number of instances of the specified objects living on the scene"),
|
||||
_("the number of _PARAM1_ living on the scene"),
|
||||
_("Objects"),
|
||||
"res/conditions/nbObjet24.png")
|
||||
.AddCodeOnlyParameter("objectsContext", "")
|
||||
.AddParameter("objectListOrEmptyWithoutPicking", _("Object"))
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
extension
|
||||
.AddExpressionAndCondition(
|
||||
"number",
|
||||
"PickedInstancesCount",
|
||||
_("Number of object instances currently picked"),
|
||||
_("the number of instances picked by the previous conditions (or "
|
||||
"actions)"),
|
||||
_("the number of _PARAM0_ currently picked"),
|
||||
_("Objects"),
|
||||
"res/conditions/nbObjet24.png")
|
||||
.AddParameter("objectListOrEmptyWithoutPicking", _("Object"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.MarkAsSimple();
|
||||
extension.AddExpressionAndCondition(
|
||||
"number",
|
||||
"PickedInstancesCount",
|
||||
_("Number of object instances currently picked"),
|
||||
_("the number of instances picked by the previous conditions (or actions)"),
|
||||
_("the number of _PARAM0_ currently picked"),
|
||||
_("Objects"),
|
||||
"res/conditions/nbObjet24.png")
|
||||
.AddParameter("objectListOrEmptyWithoutPicking", _("Object"))
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
extension
|
||||
.AddCondition(
|
||||
@@ -1581,7 +1559,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(
|
||||
"",
|
||||
"res/conditions/nbObjet.png")
|
||||
.AddParameter("objectList", _("Object"))
|
||||
.SetHidden(); // Deprecated
|
||||
.SetHidden(); // Deprecated
|
||||
|
||||
obj.AddStrExpression("ObjectName",
|
||||
_("Object name"),
|
||||
|
@@ -37,7 +37,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
"",
|
||||
"res/conditions/camera24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -69,7 +69,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
"",
|
||||
"res/conditions/camera24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -104,7 +104,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -120,7 +120,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -137,7 +137,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -154,7 +154,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -171,7 +171,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -188,7 +188,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number"), "", true)
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -201,7 +201,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
"",
|
||||
"res/conditions/camera24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -542,10 +542,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Time scale (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -575,8 +572,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsCameraExtension(
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
|
@@ -492,16 +492,6 @@ BuiltinExtensionsImplementer::ImplementsMathematicalToolsExtension(
|
||||
"",
|
||||
"res/mathfunction.png")
|
||||
.SetHelpPath("/all-features/expressions");
|
||||
|
||||
extension
|
||||
.AddExpression("lerpAngle",
|
||||
_("Lerp (Linear interpolation) between two angles"),
|
||||
_("Linearly interpolates between two angles (in degrees) by taking the shortest direction around the circle."),
|
||||
"",
|
||||
"res/mathfunction.png")
|
||||
.AddParameter("expression", _("Starting angle, in degrees"))
|
||||
.AddParameter("expression", _("Destination angle, in degrees"))
|
||||
.AddParameter("expression", _("Interpolation value between 0 and 1."));
|
||||
}
|
||||
|
||||
} // namespace gd
|
||||
|
@@ -160,7 +160,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
|
||||
"",
|
||||
"res/conditions/mouse24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -180,7 +180,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
|
||||
"",
|
||||
"res/conditions/mouse24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -276,7 +276,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
|
||||
"res/conditions/touch24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Touch identifier"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
@@ -292,7 +292,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsMouseExtension(
|
||||
"res/conditions/touch24.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("expression", _("Touch identifier"))
|
||||
.UseStandardParameters("number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.AddParameter("layer", _("Layer (base layer if empty)"), "", true)
|
||||
.SetDefaultValue("\"\"")
|
||||
.AddParameter("expression", _("Camera number (default : 0)"), "", true)
|
||||
|
@@ -31,7 +31,7 @@ class GD_CORE_API Point {
|
||||
/**
|
||||
* Change point position.
|
||||
*/
|
||||
void SetXY(double x_, double y_) {
|
||||
void SetXY(float x_, float y_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
}
|
||||
@@ -39,27 +39,27 @@ class GD_CORE_API Point {
|
||||
/**
|
||||
* Change point X position.
|
||||
*/
|
||||
void SetX(double x_) { x = x_; }
|
||||
void SetX(float x_) { x = x_; }
|
||||
|
||||
/**
|
||||
* Change point Y position.
|
||||
*/
|
||||
void SetY(double y_) { y = y_; }
|
||||
void SetY(float y_) { y = y_; }
|
||||
|
||||
/**
|
||||
* Get point X position.
|
||||
*/
|
||||
double GetX() const { return x; }
|
||||
float GetX() const { return x; }
|
||||
|
||||
/**
|
||||
* Get point Y position.
|
||||
*/
|
||||
double GetY() const { return y; }
|
||||
float GetY() const { return y; }
|
||||
|
||||
private:
|
||||
gd::String name;
|
||||
double x;
|
||||
double y;
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
#endif // GDCORE_POINT_H
|
||||
|
@@ -4,15 +4,13 @@
|
||||
* reserved. This project is released under the MIT License.
|
||||
*/
|
||||
#include "Polygon2d.h"
|
||||
|
||||
#include "GDCore/Vector2.h"
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
#include "GDCore/Vector2.h"
|
||||
|
||||
void Polygon2d::Rotate(double angle) {
|
||||
double t, cosa = cos(-angle),
|
||||
sina = sin(-angle); // We want a clockwise rotation
|
||||
void Polygon2d::Rotate(float angle) {
|
||||
float t, cosa = cos(-angle),
|
||||
sina = sin(-angle); // We want a clockwise rotation
|
||||
|
||||
for (std::size_t i = 0; i < vertices.size(); ++i) {
|
||||
t = vertices[i].x;
|
||||
@@ -21,7 +19,7 @@ void Polygon2d::Rotate(double angle) {
|
||||
}
|
||||
}
|
||||
|
||||
void Polygon2d::Move(double x, double y) {
|
||||
void Polygon2d::Move(float x, float y) {
|
||||
for (std::size_t i = 0; i < vertices.size(); i++) {
|
||||
vertices[i].x += x;
|
||||
vertices[i].y += y;
|
||||
@@ -52,13 +50,13 @@ bool Polygon2d::IsConvex() const {
|
||||
(edges[0].x * edges[0 + 1].y - edges[0].y * edges[0 + 1].x) > 0;
|
||||
|
||||
for (std::size_t i = 1; i < edges.size() - 1; ++i) {
|
||||
double zCrossProduct =
|
||||
float zCrossProduct =
|
||||
edges[i].x * edges[i + 1].y - edges[i].y * edges[i + 1].x;
|
||||
if ((zCrossProduct > 0) != zProductIsPositive) return false;
|
||||
}
|
||||
|
||||
double lastZCrossProduct = edges[edges.size() - 1].x * edges[0].y -
|
||||
edges[edges.size() - 1].y * edges[0].x;
|
||||
float lastZCrossProduct = edges[edges.size() - 1].x * edges[0].y -
|
||||
edges[edges.size() - 1].y * edges[0].x;
|
||||
if ((lastZCrossProduct > 0) != zProductIsPositive) return false;
|
||||
|
||||
return true;
|
||||
@@ -77,7 +75,7 @@ gd::Vector2f Polygon2d::ComputeCenter() const {
|
||||
return center;
|
||||
}
|
||||
|
||||
Polygon2d Polygon2d::CreateRectangle(double width, double height) {
|
||||
Polygon2d Polygon2d::CreateRectangle(float width, float height) {
|
||||
Polygon2d rect;
|
||||
rect.vertices.push_back(gd::Vector2f(-width / 2.0f, -height / 2.0f));
|
||||
rect.vertices.push_back(gd::Vector2f(+width / 2.0f, -height / 2.0f));
|
||||
|
@@ -5,9 +5,8 @@
|
||||
*/
|
||||
#ifndef GDCORE_POLYGON_H
|
||||
#define GDCORE_POLYGON_H
|
||||
#include <vector>
|
||||
|
||||
#include "GDCore/Vector2.h"
|
||||
#include <vector>
|
||||
|
||||
/**
|
||||
* \brief Represents a polygon. Usually used for collisions masks.
|
||||
@@ -43,7 +42,7 @@ class GD_CORE_API Polygon2d {
|
||||
* \note Edges are updated, there is no need to call ComputeEdges after
|
||||
* calling Move.
|
||||
*/
|
||||
void Move(double x, double y);
|
||||
void Move(float x, float y);
|
||||
|
||||
/**
|
||||
* \brief Rotate the polygon.
|
||||
@@ -53,7 +52,7 @@ class GD_CORE_API Polygon2d {
|
||||
* \warning edges vector is not updated, you have to call ComputeEdges if
|
||||
* needed.
|
||||
*/
|
||||
void Rotate(double angle);
|
||||
void Rotate(float angle);
|
||||
|
||||
/**
|
||||
* \brief Automatically fill edges vector using vertices.
|
||||
@@ -78,7 +77,7 @@ class GD_CORE_API Polygon2d {
|
||||
/**
|
||||
* \brief Create a rectangle
|
||||
*/
|
||||
static Polygon2d CreateRectangle(double width, double height);
|
||||
static Polygon2d CreateRectangle(float width, float height);
|
||||
///@}
|
||||
};
|
||||
|
||||
|
@@ -44,10 +44,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity (0-255)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("ChangeAnimation",
|
||||
@@ -60,8 +57,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/animation.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("SetAnimationName",
|
||||
@@ -90,8 +86,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
.SetHidden() // Hide as 8 direction is not supported officially in the
|
||||
// interface.
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeSprite",
|
||||
@@ -103,8 +98,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/sprite.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("PauseAnimation",
|
||||
@@ -140,9 +134,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/animation.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(_("Speed scale")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddAction("TourneVersPos",
|
||||
@@ -170,10 +162,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/scale_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeScaleWidth",
|
||||
@@ -185,10 +174,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeScaleHeight",
|
||||
@@ -200,10 +186,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeWidth",
|
||||
@@ -215,8 +198,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Width",
|
||||
@@ -228,8 +210,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeHeight",
|
||||
@@ -241,8 +222,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/actions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Height",
|
||||
@@ -254,8 +234,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("SetSize",
|
||||
@@ -281,8 +260,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/animation.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("AnimationName",
|
||||
@@ -310,8 +288,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
.SetHidden() // Hide as 8 direction is not supported officially in the
|
||||
// interface.
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("Sprite",
|
||||
_("Current frame"),
|
||||
@@ -324,8 +301,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/sprite.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("AnimStopped",
|
||||
@@ -373,10 +349,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("ScaleHeight",
|
||||
@@ -388,10 +361,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddCondition("Opacity",
|
||||
@@ -404,10 +374,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity to compare to (0-255)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsSimple();
|
||||
|
||||
obj.AddCondition(
|
||||
@@ -420,8 +387,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Sprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("ChangeColor",
|
||||
@@ -583,14 +549,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
|
||||
|
||||
obj.AddExpression("Sprite",
|
||||
_("Image"),
|
||||
_("Current frame of the animation of the object"),
|
||||
_("Animations and images"),
|
||||
"res/actions/sprite.png")
|
||||
.AddParameter("object", _("Object"), "Sprite");
|
||||
|
||||
obj.AddExpression("AnimationFrameCount",
|
||||
_("Number of frames"),
|
||||
_("Number of frames in the current animation of the object"),
|
||||
_("Animation frame of the object"),
|
||||
_("Animations and images"),
|
||||
"res/actions/sprite.png")
|
||||
.AddParameter("object", _("Object"), "Sprite");
|
||||
|
@@ -65,10 +65,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
|
||||
"res/conditions/time24.png",
|
||||
"res/conditions/time.png")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Time scale (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -151,7 +148,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsTimeExtension(
|
||||
|
||||
extension
|
||||
.AddAction("Wait",
|
||||
_("Wait X seconds"),
|
||||
_("Wait X seconds (experimental)"),
|
||||
_("Waits a number of seconds before running "
|
||||
"the next actions (and sub-events)."),
|
||||
_("Wait _PARAM0_ seconds"),
|
||||
|
@@ -34,8 +34,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/conditions/var24.png",
|
||||
"res/conditions/var.png")
|
||||
.AddParameter("scenevar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
extension
|
||||
.AddCondition("VarSceneTxt",
|
||||
@@ -46,8 +45,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/conditions/var24.png",
|
||||
"res/conditions/var.png")
|
||||
.AddParameter("scenevar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string", ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("string");
|
||||
|
||||
extension
|
||||
.AddCondition(
|
||||
@@ -109,8 +107,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/conditions/var24.png",
|
||||
"res/conditions/var.png")
|
||||
.AddParameter("globalvar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -122,8 +119,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/conditions/var24.png",
|
||||
"res/conditions/var.png")
|
||||
.AddParameter("globalvar", _("Variable"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string", ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("string")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -161,8 +157,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/actions/var24.png",
|
||||
"res/actions/var.png")
|
||||
.AddParameter("scenevar", _("Variable"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
extension
|
||||
.AddAction("ModVarSceneTxt",
|
||||
@@ -173,8 +168,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/actions/var24.png",
|
||||
"res/actions/var.png")
|
||||
.AddParameter("scenevar", _("Variable"))
|
||||
.UseStandardOperatorParameters("string",
|
||||
ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("string");
|
||||
|
||||
extension
|
||||
.AddAction(
|
||||
@@ -209,8 +203,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/actions/var24.png",
|
||||
"res/actions/var.png")
|
||||
.AddParameter("globalvar", _("Variable"))
|
||||
.UseStandardOperatorParameters("number",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
@@ -222,8 +215,7 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsVariablesExtension(
|
||||
"res/actions/var24.png",
|
||||
"res/actions/var.png")
|
||||
.AddParameter("globalvar", _("Variable"))
|
||||
.UseStandardOperatorParameters("string",
|
||||
ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("string")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
extension
|
||||
|
@@ -94,15 +94,13 @@ InstructionMetadata& InstructionMetadata::AddCodeOnlyParameter(
|
||||
}
|
||||
|
||||
InstructionMetadata& InstructionMetadata::UseStandardOperatorParameters(
|
||||
const gd::String& type, const ParameterOptions &options) {
|
||||
const gd::String& type, const gd::String& typeExtraInfo) {
|
||||
const gd::String& expressionValueType =
|
||||
gd::ValueTypeMetadata::GetPrimitiveValueType(type);
|
||||
SetManipulatedType(expressionValueType);
|
||||
|
||||
if (type == "boolean") {
|
||||
AddParameter(
|
||||
"yesorno",
|
||||
options.description.empty() ? _("New value") : options.description);
|
||||
AddParameter("yesorno", _("New value"));
|
||||
size_t valueParamIndex = parameters.size() - 1;
|
||||
|
||||
if (isObjectInstruction || isBehaviorInstruction) {
|
||||
@@ -124,9 +122,7 @@ InstructionMetadata& InstructionMetadata::UseStandardOperatorParameters(
|
||||
}
|
||||
} else {
|
||||
AddParameter("operator", _("Modification's sign"), expressionValueType);
|
||||
AddParameter(type,
|
||||
options.description.empty() ? _("Value") : options.description,
|
||||
options.typeExtraInfo);
|
||||
AddParameter(type, _("Value"), typeExtraInfo);
|
||||
|
||||
size_t operatorParamIndex = parameters.size() - 2;
|
||||
size_t valueParamIndex = parameters.size() - 1;
|
||||
@@ -159,7 +155,7 @@ InstructionMetadata& InstructionMetadata::UseStandardOperatorParameters(
|
||||
|
||||
InstructionMetadata&
|
||||
InstructionMetadata::UseStandardRelationalOperatorParameters(
|
||||
const gd::String& type, const ParameterOptions &options) {
|
||||
const gd::String& type, const gd::String& typeExtraInfo) {
|
||||
const gd::String& expressionValueType =
|
||||
gd::ValueTypeMetadata::GetPrimitiveValueType(type);
|
||||
SetManipulatedType(expressionValueType);
|
||||
@@ -179,9 +175,7 @@ InstructionMetadata::UseStandardRelationalOperatorParameters(
|
||||
}
|
||||
} else {
|
||||
AddParameter("relationalOperator", _("Sign of the test"), expressionValueType);
|
||||
AddParameter(type,
|
||||
options.description.empty() ? _("Value to compare") : options.description,
|
||||
options.typeExtraInfo);
|
||||
AddParameter(type, _("Value to compare"), typeExtraInfo);
|
||||
size_t operatorParamIndex = parameters.size() - 2;
|
||||
size_t valueParamIndex = parameters.size() - 1;
|
||||
|
||||
|
@@ -14,8 +14,6 @@
|
||||
#include "GDCore/Events/Instruction.h"
|
||||
#include "GDCore/String.h"
|
||||
#include "ParameterMetadata.h"
|
||||
#include "ParameterOptions.h"
|
||||
|
||||
namespace gd {
|
||||
class Project;
|
||||
class Layout;
|
||||
@@ -111,8 +109,8 @@ class GD_CORE_API InstructionMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the instruction asynchronicity is optional. If it is, it can
|
||||
* either be used synchronously or asynchronously, with one function for each.
|
||||
* Check if the instruction asynchronicity is optional. If it is, it can either
|
||||
* be used synchronously or asynchronously, with one function for each.
|
||||
*/
|
||||
bool IsOptionallyAsync() const {
|
||||
return IsAsync() && !codeExtraInformation.functionCallName.empty();
|
||||
@@ -225,22 +223,21 @@ class GD_CORE_API InstructionMetadata {
|
||||
/**
|
||||
* \brief Add the default parameters for an instruction manipulating the
|
||||
* specified type ("string", "number") with the default operators.
|
||||
*
|
||||
*
|
||||
* \note The type "string" can be declined in several subtypes.
|
||||
* \see ParameterMetadata
|
||||
*/
|
||||
InstructionMetadata &UseStandardOperatorParameters(
|
||||
const gd::String &type, const ParameterOptions &options);
|
||||
InstructionMetadata &UseStandardOperatorParameters(const gd::String &type, const gd::String& typeExtraInfo = "");
|
||||
|
||||
/**
|
||||
* \brief Add the default parameters for an instruction comparing the
|
||||
* specified type ("string", "number") with the default relational operators.
|
||||
*
|
||||
*
|
||||
* \note The type "string" can be declined in several subtypes.
|
||||
* \see ParameterMetadata
|
||||
*/
|
||||
InstructionMetadata &UseStandardRelationalOperatorParameters(
|
||||
const gd::String &type, const ParameterOptions &options);
|
||||
const gd::String &type, const gd::String& typeExtraInfo = "");
|
||||
|
||||
/**
|
||||
* \brief Mark the instruction as an object instruction. Automatically called
|
||||
@@ -337,12 +334,11 @@ class GD_CORE_API InstructionMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the function, doing asynchronous work, which will be
|
||||
* called in the generated code. This function should return an asynchronous
|
||||
* task (i.e: `gdjs.AsyncTask` in the JavaScript runtime).
|
||||
* Set the name of the function, doing asynchronous work, which will be called in
|
||||
* the generated code. This function should return an asynchronous task
|
||||
* (i.e: `gdjs.AsyncTask` in the JavaScript runtime).
|
||||
*
|
||||
* \param functionName the name of the function doing asynchronous work to
|
||||
* call.
|
||||
* \param functionName the name of the function doing asynchronous work to call.
|
||||
*/
|
||||
ExtraInformation &SetAsyncFunctionName(const gd::String &functionName_) {
|
||||
asyncFunctionCallName = functionName_;
|
||||
@@ -486,12 +482,12 @@ class GD_CORE_API InstructionMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the name of the function, doing asynchronous work, which will be called
|
||||
* in the generated code. This function should return an asynchronous task
|
||||
* Set the name of the function, doing asynchronous work, which will be called in
|
||||
* the generated code. This function should return an asynchronous task
|
||||
* (i.e: `gdjs.AsyncTask` in the JavaScript runtime).
|
||||
*
|
||||
* \param functionName the name of the function doing asynchronous work to
|
||||
* call. \note Shortcut for `codeExtraInformation.SetAsyncFunctionName`.
|
||||
* \param functionName the name of the function doing asynchronous work to call.
|
||||
* \note Shortcut for `codeExtraInformation.SetAsyncFunctionName`.
|
||||
*/
|
||||
ExtraInformation &SetAsyncFunctionName(const gd::String &functionName) {
|
||||
return codeExtraInformation.SetAsyncFunctionName(functionName);
|
||||
@@ -516,7 +512,7 @@ class GD_CORE_API InstructionMetadata {
|
||||
/**
|
||||
* \brief Get the files that must be included to use the instruction.
|
||||
*/
|
||||
const std::vector<gd::String> &GetIncludeFiles() const {
|
||||
const std::vector<gd::String>& GetIncludeFiles() const {
|
||||
return codeExtraInformation.GetIncludeFiles();
|
||||
};
|
||||
|
||||
|
@@ -8,8 +8,6 @@
|
||||
#include "GDCore/Extensions/Metadata/ExpressionMetadata.h"
|
||||
#include "GDCore/Extensions/Metadata/InstructionMetadata.h"
|
||||
#include "GDCore/String.h"
|
||||
#include "ParameterOptions.h"
|
||||
|
||||
namespace gd {} // namespace gd
|
||||
|
||||
namespace gd {
|
||||
@@ -34,7 +32,8 @@ class GD_CORE_API MultipleInstructionMetadata {
|
||||
return MultipleInstructionMetadata(expression, condition, action);
|
||||
}
|
||||
static MultipleInstructionMetadata WithConditionAndAction(
|
||||
gd::InstructionMetadata &condition, gd::InstructionMetadata &action) {
|
||||
gd::InstructionMetadata &condition,
|
||||
gd::InstructionMetadata &action) {
|
||||
return MultipleInstructionMetadata(condition, action);
|
||||
}
|
||||
|
||||
@@ -84,8 +83,7 @@ class GD_CORE_API MultipleInstructionMetadata {
|
||||
/**
|
||||
* \see gd::InstructionMetadata::SetParameterExtraInfo
|
||||
*/
|
||||
MultipleInstructionMetadata &SetParameterExtraInfo(
|
||||
const gd::String &defaultValue) {
|
||||
MultipleInstructionMetadata &SetParameterExtraInfo(const gd::String &defaultValue) {
|
||||
if (expression) expression->SetParameterExtraInfo(defaultValue);
|
||||
if (condition) condition->SetParameterExtraInfo(defaultValue);
|
||||
if (action) action->SetParameterExtraInfo(defaultValue);
|
||||
@@ -128,11 +126,9 @@ class GD_CORE_API MultipleInstructionMetadata {
|
||||
* \see gd::InstructionMetadata::UseStandardOperatorParameters
|
||||
* \see gd::InstructionMetadata::UseStandardRelationalOperatorParameters
|
||||
*/
|
||||
MultipleInstructionMetadata &UseStandardParameters(
|
||||
const gd::String &type, const ParameterOptions &options) {
|
||||
if (condition)
|
||||
condition->UseStandardRelationalOperatorParameters(type, options);
|
||||
if (action) action->UseStandardOperatorParameters(type, options);
|
||||
MultipleInstructionMetadata &UseStandardParameters(const gd::String &type, const gd::String& typeExtraInfo = "") {
|
||||
if (condition) condition->UseStandardRelationalOperatorParameters(type, typeExtraInfo);
|
||||
if (action) action->UseStandardOperatorParameters(type, typeExtraInfo);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -171,12 +167,13 @@ class GD_CORE_API MultipleInstructionMetadata {
|
||||
/**
|
||||
* \brief Get the files that must be included to use the instruction.
|
||||
*/
|
||||
const std::vector<gd::String> &GetIncludeFiles() const {
|
||||
const std::vector<gd::String>& GetIncludeFiles() const {
|
||||
if (expression)
|
||||
return expression->GetCodeExtraInformation().GetIncludeFiles();
|
||||
if (condition)
|
||||
return condition->GetCodeExtraInformation().GetIncludeFiles();
|
||||
if (action) return action->GetCodeExtraInformation().GetIncludeFiles();
|
||||
if (action)
|
||||
return action->GetCodeExtraInformation().GetIncludeFiles();
|
||||
// It can't actually happen.
|
||||
throw std::logic_error("no instruction metadata");
|
||||
}
|
||||
@@ -185,9 +182,12 @@ class GD_CORE_API MultipleInstructionMetadata {
|
||||
* \see gd::InstructionMetadata::SetPrivate
|
||||
*/
|
||||
MultipleInstructionMetadata &SetPrivate() {
|
||||
if (expression) expression->SetPrivate();
|
||||
if (condition) condition->SetPrivate();
|
||||
if (action) action->SetPrivate();
|
||||
if (expression)
|
||||
expression->SetPrivate();
|
||||
if (condition)
|
||||
condition->SetPrivate();
|
||||
if (action)
|
||||
action->SetPrivate();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* GDevelop Core
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
|
||||
* reserved. This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#ifndef PARAMETEROPTIONS_H
|
||||
#define PARAMETEROPTIONS_H
|
||||
#include "GDCore/String.h"
|
||||
#include "ParameterMetadata.h"
|
||||
|
||||
namespace gd {} // namespace gd
|
||||
|
||||
namespace gd {
|
||||
struct GD_CORE_API ParameterOptions {
|
||||
gd::String description;
|
||||
gd::String typeExtraInfo;
|
||||
|
||||
ParameterOptions &SetDescription(const gd::String &description_) {
|
||||
description = description_;
|
||||
return *this;
|
||||
}
|
||||
ParameterOptions &SetTypeExtraInfo(const gd::String &typeExtraInfo_) {
|
||||
typeExtraInfo = typeExtraInfo_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
static ParameterOptions MakeNewOptions() {
|
||||
ParameterOptions emptyOptions;
|
||||
return emptyOptions;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PARAMETEROPTIONS_H
|
@@ -3,6 +3,7 @@
|
||||
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
|
||||
* reserved. This project is released under the MIT License.
|
||||
*/
|
||||
#if defined(GD_IDE_ONLY)
|
||||
#ifndef SCENECANVASSETTINGS_H
|
||||
#define SCENECANVASSETTINGS_H
|
||||
#include "GDCore/String.h"
|
||||
@@ -42,3 +43,4 @@ private:
|
||||
} // namespace gd
|
||||
|
||||
#endif // SCENECANVASSETTINGS_H
|
||||
#endif
|
||||
|
@@ -35,16 +35,6 @@ void ArbitraryResourceWorker::ExposeJson(gd::String& jsonName){
|
||||
// do.
|
||||
};
|
||||
|
||||
void ArbitraryResourceWorker::ExposeTilemap(gd::String& tilemapName){
|
||||
// Nothing to do by default - each child class can define here the action to
|
||||
// do.
|
||||
};
|
||||
|
||||
void ArbitraryResourceWorker::ExposeTileset(gd::String& tilesetName){
|
||||
// Nothing to do by default - each child class can define here the action to
|
||||
// do.
|
||||
};
|
||||
|
||||
void ArbitraryResourceWorker::ExposeVideo(gd::String& videoName){
|
||||
// Nothing to do by default - each child class can define here the action to
|
||||
// do.
|
||||
@@ -102,67 +92,6 @@ void ArbitraryResourceWorker::ExposeResources(
|
||||
}
|
||||
}
|
||||
|
||||
void ArbitraryResourceWorker::ExposeEmbeddeds(gd::String& resourceName) {
|
||||
if (resourcesManagers.empty()) return;
|
||||
gd::ResourcesManager* resourcesManager = resourcesManagers[0];
|
||||
|
||||
gd::Resource& resource = resourcesManager->GetResource(resourceName);
|
||||
|
||||
if (!resource.GetMetadata().empty()) {
|
||||
gd::SerializerElement serializerElement =
|
||||
gd::Serializer::FromJSON(resource.GetMetadata());
|
||||
|
||||
if (serializerElement.HasChild("embeddedResourcesMapping")) {
|
||||
bool anyEmbeddedResourceNameWasRenamed = false;
|
||||
gd::SerializerElement& embeddedResourcesMappingElement =
|
||||
serializerElement.GetChild("embeddedResourcesMapping");
|
||||
|
||||
for (const auto& child :
|
||||
embeddedResourcesMappingElement.GetAllChildren()) {
|
||||
const gd::String& targetResourceName =
|
||||
child.second->GetValue().GetString();
|
||||
|
||||
if (resourcesManager->HasResource(targetResourceName)) {
|
||||
std::cout << targetResourceName << std::endl;
|
||||
gd::Resource& targetResource =
|
||||
resourcesManager->GetResource(targetResourceName);
|
||||
const gd::String& targetResourceKind = targetResource.GetKind();
|
||||
|
||||
gd::String potentiallyUpdatedTargetResourceName = targetResourceName;
|
||||
|
||||
if (targetResourceKind == "audio") {
|
||||
ExposeAudio(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "bitmapFont") {
|
||||
ExposeBitmapFont(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "font") {
|
||||
ExposeFont(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "image") {
|
||||
ExposeImage(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "json") {
|
||||
ExposeJson(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "tilemap") {
|
||||
ExposeTilemap(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "tileset") {
|
||||
ExposeTileset(potentiallyUpdatedTargetResourceName);
|
||||
} else if (targetResourceKind == "video") {
|
||||
ExposeVideo(potentiallyUpdatedTargetResourceName);
|
||||
}
|
||||
|
||||
if (potentiallyUpdatedTargetResourceName != targetResourceName) {
|
||||
// The resource name was renamed. Also update the mapping.
|
||||
child.second->SetStringValue(potentiallyUpdatedTargetResourceName);
|
||||
anyEmbeddedResourceNameWasRenamed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (anyEmbeddedResourceNameWasRenamed) {
|
||||
resource.SetMetadata(gd::Serializer::ToJSON(serializerElement));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ArbitraryResourceWorker::ExposeResource(gd::Resource& resource) {
|
||||
if (!resource.UseFile()) return;
|
||||
|
||||
@@ -225,14 +154,6 @@ class ResourceWorkerInEventsWorker : public ArbitraryEventsWorker {
|
||||
gd::String updatedParameterValue = parameterValue;
|
||||
worker.ExposeJson(updatedParameterValue);
|
||||
instruction.SetParameter(parameterIndex, updatedParameterValue);
|
||||
} else if (parameterMetadata.GetType() == "tilemapResource") {
|
||||
gd::String updatedParameterValue = parameterValue;
|
||||
worker.ExposeTilemap(updatedParameterValue);
|
||||
instruction.SetParameter(parameterIndex, updatedParameterValue);
|
||||
} else if (parameterMetadata.GetType() == "tilesetResource") {
|
||||
gd::String updatedParameterValue = parameterValue;
|
||||
worker.ExposeTileset(updatedParameterValue);
|
||||
instruction.SetParameter(parameterIndex, updatedParameterValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -75,16 +75,6 @@ class GD_CORE_API ArbitraryResourceWorker {
|
||||
*/
|
||||
virtual void ExposeJson(gd::String &jsonName);
|
||||
|
||||
/**
|
||||
* \brief Expose a Tilemap, which is always a reference to a "tilemap" resource.
|
||||
*/
|
||||
virtual void ExposeTilemap(gd::String &tilemapName);
|
||||
|
||||
/**
|
||||
* \brief Expose a Tileset, which is always a reference to a "tileset" resource.
|
||||
*/
|
||||
virtual void ExposeTileset(gd::String &tilesetName);
|
||||
|
||||
/**
|
||||
* \brief Expose a video, which is always a reference to a "video" resource.
|
||||
*/
|
||||
@@ -106,11 +96,6 @@ class GD_CORE_API ArbitraryResourceWorker {
|
||||
*/
|
||||
virtual void ExposeFile(gd::String &resourceFileName) = 0;
|
||||
|
||||
/**
|
||||
* \brief Expose the embedded resources of the specified resource.
|
||||
*/
|
||||
virtual void ExposeEmbeddeds(gd::String &resourceName);
|
||||
|
||||
protected:
|
||||
const std::vector<gd::ResourcesManager *> &GetResources() {
|
||||
return resourcesManagers;
|
||||
|
@@ -40,8 +40,6 @@ class ResourcesInUseHelper : public gd::ArbitraryResourceWorker {
|
||||
std::set<gd::String>& GetAllAudios() { return GetAll("audio"); };
|
||||
std::set<gd::String>& GetAllFonts() { return GetAll("font"); };
|
||||
std::set<gd::String>& GetAllJsons() { return GetAll("json"); };
|
||||
std::set<gd::String>& GetAllTilemaps() { return GetAll("tilemap"); };
|
||||
std::set<gd::String>& GetAllTilesets() { return GetAll("tileset"); };
|
||||
std::set<gd::String>& GetAllVideos() { return GetAll("video"); };
|
||||
std::set<gd::String>& GetAllBitmapFonts() { return GetAll("bitmapFont"); };
|
||||
std::set<gd::String>& GetAll(const gd::String& resourceType) {
|
||||
@@ -49,8 +47,6 @@ class ResourcesInUseHelper : public gd::ArbitraryResourceWorker {
|
||||
if (resourceType == "audio") return allAudios;
|
||||
if (resourceType == "font") return allFonts;
|
||||
if (resourceType == "json") return allJsons;
|
||||
if (resourceType == "tilemap") return allTilemaps;
|
||||
if (resourceType == "tileset") return allTilesets;
|
||||
if (resourceType == "video") return allVideos;
|
||||
if (resourceType == "bitmapFont") return allBitmapFonts;
|
||||
|
||||
@@ -72,12 +68,6 @@ class ResourcesInUseHelper : public gd::ArbitraryResourceWorker {
|
||||
virtual void ExposeJson(gd::String& jsonResourceName) override {
|
||||
allJsons.insert(jsonResourceName);
|
||||
};
|
||||
virtual void ExposeTilemap(gd::String& tilemapResourceName) override {
|
||||
allTilemaps.insert(tilemapResourceName);
|
||||
};
|
||||
virtual void ExposeTileset(gd::String& tilesetResourceName) override {
|
||||
allTilesets.insert(tilesetResourceName);
|
||||
};
|
||||
virtual void ExposeVideo(gd::String& videoResourceName) override {
|
||||
allVideos.insert(videoResourceName);
|
||||
};
|
||||
@@ -90,8 +80,6 @@ class ResourcesInUseHelper : public gd::ArbitraryResourceWorker {
|
||||
std::set<gd::String> allAudios;
|
||||
std::set<gd::String> allFonts;
|
||||
std::set<gd::String> allJsons;
|
||||
std::set<gd::String> allTilemaps;
|
||||
std::set<gd::String> allTilesets;
|
||||
std::set<gd::String> allVideos;
|
||||
std::set<gd::String> allBitmapFonts;
|
||||
std::set<gd::String> emptyResources;
|
||||
|
@@ -49,12 +49,6 @@ class ResourcesRenamer : public gd::ArbitraryResourceWorker {
|
||||
virtual void ExposeJson(gd::String& jsonResourceName) override {
|
||||
RenameIfNeeded(jsonResourceName);
|
||||
};
|
||||
virtual void ExposeTilemap(gd::String& tilemapResourceName) override {
|
||||
RenameIfNeeded(tilemapResourceName);
|
||||
};
|
||||
virtual void ExposeTileset(gd::String& tilesetResourceName) override {
|
||||
RenameIfNeeded(tilesetResourceName);
|
||||
};
|
||||
virtual void ExposeVideo(gd::String& videoResourceName) override {
|
||||
RenameIfNeeded(videoResourceName);
|
||||
};
|
||||
|
@@ -38,7 +38,7 @@ gd::ObjectConfiguration &CustomObjectConfiguration::GetChildObjectConfiguration(
|
||||
return badObjectConfiguration;
|
||||
}
|
||||
const auto &eventsBasedObject = project->GetEventsBasedObject(GetType());
|
||||
|
||||
|
||||
if (!eventsBasedObject.HasObjectNamed(objectName)) {
|
||||
gd::LogError("Tried to get the configuration of a child-object:" + objectName
|
||||
+ " that doesn't exist in the event-based object: " + GetType());
|
||||
@@ -78,7 +78,7 @@ bool CustomObjectConfiguration::UpdateProperty(const gd::String& propertyName,
|
||||
}
|
||||
const auto &eventsBasedObject = project->GetEventsBasedObject(GetType());
|
||||
const auto &properties = eventsBasedObject.GetPropertyDescriptors();
|
||||
|
||||
|
||||
return gd::CustomConfigurationHelper::UpdateProperty(
|
||||
properties,
|
||||
objectContent,
|
||||
@@ -125,7 +125,8 @@ void CustomObjectConfiguration::DoUnserializeFrom(Project& project,
|
||||
}
|
||||
}
|
||||
|
||||
void CustomObjectConfiguration::ExposeResources(gd::ArbitraryResourceWorker& worker) {
|
||||
void CustomObjectConfiguration::ExposeResources(
|
||||
gd::ArbitraryResourceWorker& worker) {
|
||||
std::map<gd::String, gd::PropertyDescriptor> properties = GetProperties();
|
||||
|
||||
for (auto& property : properties) {
|
||||
@@ -147,10 +148,6 @@ void CustomObjectConfiguration::ExposeResources(gd::ArbitraryResourceWorker& wor
|
||||
worker.ExposeVideo(newPropertyValue);
|
||||
} else if (resourceType == "json") {
|
||||
worker.ExposeJson(newPropertyValue);
|
||||
} else if (resourceType == "tilemap") {
|
||||
worker.ExposeTilemap(newPropertyValue);
|
||||
} else if (resourceType == "tileset") {
|
||||
worker.ExposeTileset(newPropertyValue);
|
||||
} else if (resourceType == "bitmapFont") {
|
||||
worker.ExposeBitmapFont(newPropertyValue);
|
||||
}
|
||||
|
@@ -87,9 +87,9 @@ class CustomObjectConfiguration : public gd::ObjectConfiguration {
|
||||
/**
|
||||
* Initialize configuration using another configuration. Used by copy-ctor
|
||||
* and assign-op.
|
||||
*
|
||||
*
|
||||
* Don't forget to update me if members were changed!
|
||||
*
|
||||
*
|
||||
* It's needed because there is no default copy for childObjectConfigurations
|
||||
* and it must be a deep copy.
|
||||
*/
|
||||
|
@@ -7,14 +7,13 @@
|
||||
#ifndef GDCORE_INITIALINSTANCE_H
|
||||
#define GDCORE_INITIALINSTANCE_H
|
||||
#include <map>
|
||||
|
||||
#include "GDCore/Project/VariablesContainer.h"
|
||||
#include "GDCore/String.h"
|
||||
namespace gd {
|
||||
class PropertyDescriptor;
|
||||
class Project;
|
||||
class Layout;
|
||||
} // namespace gd
|
||||
}
|
||||
|
||||
namespace gd {
|
||||
|
||||
@@ -128,8 +127,7 @@ class GD_CORE_API InitialInstance {
|
||||
void SetCustomHeight(double height_) { height = height_; }
|
||||
|
||||
/**
|
||||
* \brief Return true if the instance is locked and cannot be moved in the
|
||||
* IDE.
|
||||
* \brief Return true if the instance is locked and cannot be moved in the IDE.
|
||||
*/
|
||||
bool IsLocked() const { return locked; };
|
||||
|
||||
@@ -242,7 +240,7 @@ class GD_CORE_API InitialInstance {
|
||||
* \brief Set the value of a string property stored in the instance.
|
||||
*/
|
||||
void SetRawStringProperty(const gd::String& name, const gd::String& value);
|
||||
///@}
|
||||
///@}
|
||||
|
||||
/** \name Saving and loading
|
||||
* Members functions related to serialization.
|
||||
@@ -274,19 +272,18 @@ class GD_CORE_API InitialInstance {
|
||||
stringProperties; ///< More data which can be used by the object
|
||||
|
||||
gd::String objectName; ///< Object name
|
||||
double x; ///< Object initial X position
|
||||
double y; ///< Object initial Y position
|
||||
double angle; ///< Object initial angle
|
||||
double x; ///< Object initial X position
|
||||
double y; ///< Object initial Y position
|
||||
double angle; ///< Object initial angle
|
||||
int zOrder; ///< Object initial Z order
|
||||
gd::String layer; ///< Object initial layer
|
||||
bool personalizedSize; ///< True if object has a custom size
|
||||
double width; ///< Object custom width
|
||||
double height; ///< Object custom height
|
||||
double width; ///< Object custom width
|
||||
double height; ///< Object custom height
|
||||
gd::VariablesContainer initialVariables; ///< Instance specific variables
|
||||
bool locked; ///< True if the instance is locked
|
||||
bool sealed; ///< True if the instance is sealed
|
||||
mutable gd::String persistentUuid; ///< A persistent random version 4 UUID,
|
||||
///< useful for hot reloading.
|
||||
mutable gd::String persistentUuid; ///< A persistent random version 4 UUID, useful for hot reloading.
|
||||
|
||||
static gd::String*
|
||||
badStringProperyValue; ///< Empty string returned by GetRawStringProperty
|
||||
|
@@ -60,6 +60,7 @@ void InitialInstancesContainer::IterateOverInstancesWithZOrdering(
|
||||
for (auto& instance : sortedInstances) func(instance);
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
gd::InitialInstance& InitialInstancesContainer::InsertNewInitialInstance() {
|
||||
gd::InitialInstance newInstance;
|
||||
initialInstances.push_back(newInstance);
|
||||
@@ -172,6 +173,7 @@ void InitialInstancesContainer::SerializeTo(SerializerElement& element) const {
|
||||
}
|
||||
|
||||
void InitialInstancesContainer::Clear() { initialInstances.clear(); }
|
||||
#endif
|
||||
|
||||
InitialInstanceFunctor::~InitialInstanceFunctor(){};
|
||||
|
||||
|
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "GDCore/Project/Behavior.h"
|
||||
#include "GDCore/Project/EffectsContainer.h"
|
||||
#include "GDCore/Project/ResourcesManager.h"
|
||||
#include "GDCore/Project/VariablesContainer.h"
|
||||
#include "GDCore/String.h"
|
||||
#include "GDCore/Tools/MakeUnique.h"
|
||||
|
@@ -22,8 +22,8 @@
|
||||
#include "GDCore/IDE/Events/UsedExtensionsFinder.h"
|
||||
#include "GDCore/IDE/PlatformManager.h"
|
||||
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
|
||||
#include "GDCore/Project/CustomObjectConfiguration.h"
|
||||
#include "GDCore/Project/EventsFunctionsExtension.h"
|
||||
#include "GDCore/Project/CustomObjectConfiguration.h"
|
||||
#include "GDCore/Project/ExternalEvents.h"
|
||||
#include "GDCore/Project/ExternalLayout.h"
|
||||
#include "GDCore/Project/Layout.h"
|
||||
@@ -347,49 +347,6 @@ void Project::RemoveExternalEvents(const gd::String& name) {
|
||||
externalEvents.erase(events);
|
||||
}
|
||||
|
||||
void Project::MoveLayout(std::size_t oldIndex, std::size_t newIndex) {
|
||||
if (oldIndex >= scenes.size() || newIndex >= scenes.size()) return;
|
||||
|
||||
std::unique_ptr<gd::Layout> scene = std::move(scenes[oldIndex]);
|
||||
scenes.erase(scenes.begin() + oldIndex);
|
||||
scenes.insert(scenes.begin() + newIndex, std::move(scene));
|
||||
};
|
||||
|
||||
void Project::MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex) {
|
||||
if (oldIndex >= externalEvents.size() || newIndex >= externalEvents.size())
|
||||
return;
|
||||
|
||||
std::unique_ptr<gd::ExternalEvents> externalEventsItem =
|
||||
std::move(externalEvents[oldIndex]);
|
||||
externalEvents.erase(externalEvents.begin() + oldIndex);
|
||||
externalEvents.insert(externalEvents.begin() + newIndex,
|
||||
std::move(externalEventsItem));
|
||||
};
|
||||
|
||||
void Project::MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex) {
|
||||
if (oldIndex >= externalLayouts.size() || newIndex >= externalLayouts.size())
|
||||
return;
|
||||
|
||||
std::unique_ptr<gd::ExternalLayout> externalLayout =
|
||||
std::move(externalLayouts[oldIndex]);
|
||||
externalLayouts.erase(externalLayouts.begin() + oldIndex);
|
||||
externalLayouts.insert(externalLayouts.begin() + newIndex,
|
||||
std::move(externalLayout));
|
||||
};
|
||||
|
||||
void Project::MoveEventsFunctionsExtension(std::size_t oldIndex,
|
||||
std::size_t newIndex) {
|
||||
if (oldIndex >= eventsFunctionsExtensions.size() ||
|
||||
newIndex >= eventsFunctionsExtensions.size())
|
||||
return;
|
||||
|
||||
std::unique_ptr<gd::EventsFunctionsExtension> eventsFunctionsExtension =
|
||||
std::move(eventsFunctionsExtensions[oldIndex]);
|
||||
eventsFunctionsExtensions.erase(eventsFunctionsExtensions.begin() + oldIndex);
|
||||
eventsFunctionsExtensions.insert(eventsFunctionsExtensions.begin() + newIndex,
|
||||
std::move(eventsFunctionsExtension));
|
||||
};
|
||||
|
||||
void Project::SwapExternalEvents(std::size_t first, std::size_t second) {
|
||||
if (first >= externalEvents.size() || second >= externalEvents.size()) return;
|
||||
|
||||
@@ -982,10 +939,8 @@ void Project::ExposeResources(gd::ArbitraryResourceWorker& worker) {
|
||||
// (this time for effects). Ideally, this method could be moved outside of
|
||||
// gd::Project.
|
||||
|
||||
gd::ResourcesManager* resourcesManager = &GetResourcesManager();
|
||||
|
||||
// Add project resources
|
||||
worker.ExposeResources(resourcesManager);
|
||||
worker.ExposeResources(&GetResourcesManager());
|
||||
platformSpecificAssets.ExposeResources(worker);
|
||||
|
||||
// Add layouts resources
|
||||
|
@@ -165,7 +165,7 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
*/
|
||||
const gd::String& GetPackageName() const { return packageName; }
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief Change the slug of the template from which the project is created.
|
||||
*/
|
||||
void SetTemplateSlug(const gd::String& templateSlug_) {
|
||||
@@ -458,7 +458,7 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
|
||||
/**
|
||||
* Create an object of the given type with the specified name.
|
||||
*
|
||||
*
|
||||
* \param type The type of the object
|
||||
* \param name The name of the object
|
||||
*/
|
||||
@@ -467,7 +467,7 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
|
||||
/**
|
||||
* Create an object configuration of the given type.
|
||||
*
|
||||
*
|
||||
* \param type The type of the object
|
||||
*/
|
||||
std::unique_ptr<gd::ObjectConfiguration> CreateObjectConfiguration(
|
||||
@@ -525,11 +525,6 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
*/
|
||||
std::size_t GetLayoutPosition(const gd::String& name) const;
|
||||
|
||||
/**
|
||||
* Change the position of the specified layout.
|
||||
*/
|
||||
void MoveLayout(std::size_t oldIndex, std::size_t newIndex);
|
||||
|
||||
/**
|
||||
* \brief Swap the specified layouts.
|
||||
*
|
||||
@@ -633,11 +628,6 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
*/
|
||||
std::size_t GetExternalEventsPosition(const gd::String& name) const;
|
||||
|
||||
/**
|
||||
* Change the position of the specified external events.
|
||||
*/
|
||||
void MoveExternalEvents(std::size_t oldIndex, std::size_t newIndex);
|
||||
|
||||
/**
|
||||
* \brief Swap the specified external events.
|
||||
*
|
||||
@@ -712,11 +702,6 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
*/
|
||||
std::size_t GetExternalLayoutPosition(const gd::String& name) const;
|
||||
|
||||
/**
|
||||
* Change the position of the specified external layout.
|
||||
*/
|
||||
void MoveExternalLayout(std::size_t oldIndex, std::size_t newIndex);
|
||||
|
||||
/**
|
||||
* \brief Swap the specified external layouts.
|
||||
*
|
||||
@@ -806,11 +791,6 @@ class GD_CORE_API Project : public ObjectsContainer {
|
||||
*/
|
||||
std::size_t GetEventsFunctionsExtensionPosition(const gd::String& name) const;
|
||||
|
||||
/**
|
||||
* Change the position of the specified events function extension.
|
||||
*/
|
||||
void MoveEventsFunctionsExtension(std::size_t oldIndex, std::size_t newIndex);
|
||||
|
||||
/**
|
||||
* \brief Swap the specified events functions extensions.
|
||||
*
|
||||
|
@@ -85,10 +85,6 @@ std::shared_ptr<Resource> ResourcesManager::CreateResource(
|
||||
return std::make_shared<VideoResource>();
|
||||
else if (kind == "json")
|
||||
return std::make_shared<JsonResource>();
|
||||
else if (kind == "tilemap")
|
||||
return std::make_shared<TilemapResource>();
|
||||
else if (kind == "tileset")
|
||||
return std::make_shared<TilesetResource>();
|
||||
else if (kind == "bitmapFont")
|
||||
return std::make_shared<BitmapFontResource>();
|
||||
|
||||
@@ -654,74 +650,6 @@ bool JsonResource::UpdateProperty(const gd::String& name,
|
||||
return true;
|
||||
}
|
||||
|
||||
void TilemapResource::SetFile(const gd::String& newFile) {
|
||||
file = NormalizePathSeparator(newFile);
|
||||
}
|
||||
|
||||
void TilemapResource::UnserializeFrom(const SerializerElement& element) {
|
||||
SetUserAdded(element.GetBoolAttribute("userAdded"));
|
||||
SetFile(element.GetStringAttribute("file"));
|
||||
DisablePreload(element.GetBoolAttribute("disablePreload", false));
|
||||
}
|
||||
|
||||
void TilemapResource::SerializeTo(SerializerElement& element) const {
|
||||
element.SetAttribute("userAdded", IsUserAdded());
|
||||
element.SetAttribute("file", GetFile());
|
||||
element.SetAttribute("disablePreload", IsPreloadDisabled());
|
||||
}
|
||||
|
||||
std::map<gd::String, gd::PropertyDescriptor> TilemapResource::GetProperties()
|
||||
const {
|
||||
std::map<gd::String, gd::PropertyDescriptor> properties;
|
||||
properties["disablePreload"]
|
||||
.SetValue(disablePreload ? "true" : "false")
|
||||
.SetType("Boolean")
|
||||
.SetLabel(_("Disable preloading at game startup"));
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
bool TilemapResource::UpdateProperty(const gd::String& name,
|
||||
const gd::String& value) {
|
||||
if (name == "disablePreload") disablePreload = value == "1";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TilesetResource::SetFile(const gd::String& newFile) {
|
||||
file = NormalizePathSeparator(newFile);
|
||||
}
|
||||
|
||||
void TilesetResource::UnserializeFrom(const SerializerElement& element) {
|
||||
SetUserAdded(element.GetBoolAttribute("userAdded"));
|
||||
SetFile(element.GetStringAttribute("file"));
|
||||
DisablePreload(element.GetBoolAttribute("disablePreload", false));
|
||||
}
|
||||
|
||||
void TilesetResource::SerializeTo(SerializerElement& element) const {
|
||||
element.SetAttribute("userAdded", IsUserAdded());
|
||||
element.SetAttribute("file", GetFile());
|
||||
element.SetAttribute("disablePreload", IsPreloadDisabled());
|
||||
}
|
||||
|
||||
std::map<gd::String, gd::PropertyDescriptor> TilesetResource::GetProperties()
|
||||
const {
|
||||
std::map<gd::String, gd::PropertyDescriptor> properties;
|
||||
properties["disablePreload"]
|
||||
.SetValue(disablePreload ? "true" : "false")
|
||||
.SetType("Boolean")
|
||||
.SetLabel(_("Disable preloading at game startup"));
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
bool TilesetResource::UpdateProperty(const gd::String& name,
|
||||
const gd::String& value) {
|
||||
if (name == "disablePreload") disablePreload = value == "1";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BitmapFontResource::SetFile(const gd::String& newFile) {
|
||||
file = NormalizePathSeparator(newFile);
|
||||
}
|
||||
|
@@ -373,88 +373,6 @@ class GD_CORE_API JsonResource : public Resource {
|
||||
gd::String file;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Describe a tilemap file used by a project.
|
||||
*
|
||||
* \see Resource
|
||||
* \ingroup ResourcesManagement
|
||||
*/
|
||||
class GD_CORE_API TilemapResource : public Resource {
|
||||
public:
|
||||
TilemapResource() : Resource(), disablePreload(false) { SetKind("tilemap"); };
|
||||
virtual ~TilemapResource(){};
|
||||
virtual TilemapResource* Clone() const override {
|
||||
return new TilemapResource(*this);
|
||||
}
|
||||
|
||||
virtual const gd::String& GetFile() const override { return file; };
|
||||
virtual void SetFile(const gd::String& newFile) override;
|
||||
|
||||
virtual bool UseFile() const override { return true; }
|
||||
|
||||
std::map<gd::String, gd::PropertyDescriptor> GetProperties() const override;
|
||||
bool UpdateProperty(const gd::String& name, const gd::String& value) override;
|
||||
|
||||
void SerializeTo(SerializerElement& element) const override;
|
||||
|
||||
void UnserializeFrom(const SerializerElement& element) override;
|
||||
|
||||
/**
|
||||
* \brief Return true if the loading at game startup must be disabled
|
||||
*/
|
||||
bool IsPreloadDisabled() const { return disablePreload; }
|
||||
|
||||
/**
|
||||
* \brief Set if the tilemap preload at game startup must be disabled
|
||||
*/
|
||||
void DisablePreload(bool disable = true) { disablePreload = disable; }
|
||||
|
||||
private:
|
||||
bool disablePreload; ///< If "true", don't load the tilemap at game startup
|
||||
gd::String file;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Describe a tileset file used by a project.
|
||||
*
|
||||
* \see Resource
|
||||
* \ingroup ResourcesManagement
|
||||
*/
|
||||
class GD_CORE_API TilesetResource : public Resource {
|
||||
public:
|
||||
TilesetResource() : Resource(), disablePreload(false) { SetKind("tileset"); };
|
||||
virtual ~TilesetResource(){};
|
||||
virtual TilesetResource* Clone() const override {
|
||||
return new TilesetResource(*this);
|
||||
}
|
||||
|
||||
virtual const gd::String& GetFile() const override { return file; };
|
||||
virtual void SetFile(const gd::String& newFile) override;
|
||||
|
||||
virtual bool UseFile() const override { return true; }
|
||||
|
||||
std::map<gd::String, gd::PropertyDescriptor> GetProperties() const override;
|
||||
bool UpdateProperty(const gd::String& name, const gd::String& value) override;
|
||||
|
||||
void SerializeTo(SerializerElement& element) const override;
|
||||
|
||||
void UnserializeFrom(const SerializerElement& element) override;
|
||||
|
||||
/**
|
||||
* \brief Return true if the loading at game startup must be disabled
|
||||
*/
|
||||
bool IsPreloadDisabled() const { return disablePreload; }
|
||||
|
||||
/**
|
||||
* \brief Set if the tilemap preload at game startup must be disabled
|
||||
*/
|
||||
void DisablePreload(bool disable = true) { disablePreload = disable; }
|
||||
|
||||
private:
|
||||
bool disablePreload; ///< If "true", don't load the tilemap at game startup
|
||||
gd::String file;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Describe a bitmap font file used by a project.
|
||||
*
|
||||
|
@@ -3,7 +3,8 @@
|
||||
#ifndef GDCORE_VECTOR2_H
|
||||
#define GDCORE_VECTOR2_H
|
||||
|
||||
namespace gd {
|
||||
namespace gd
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -11,12 +12,11 @@ namespace gd {
|
||||
// Copyright (C) 2007-2016 Laurent Gomila (laurent@sfml-dev.org)
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty.
|
||||
// In no event will the authors be held liable for any damages arising from the
|
||||
// use of this software.
|
||||
// In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// including commercial applications, and to alter it and redistribute it freely,
|
||||
// subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented;
|
||||
// you must not claim that you wrote the original software.
|
||||
|
@@ -19,77 +19,15 @@ TEST_CASE("ResourcesRenamer", "[common]") {
|
||||
gd::ResourcesRenamer resourcesRenamer(renamings);
|
||||
|
||||
gd::Project project;
|
||||
|
||||
// Add "classic", plain resources.
|
||||
gd::ImageResource resource1;
|
||||
resource1.SetName("Resource1");
|
||||
project.GetResourcesManager().AddResource(resource1);
|
||||
gd::ImageResource resource2;
|
||||
resource2.SetName("Resource2");
|
||||
project.GetResourcesManager().AddResource(resource2);
|
||||
|
||||
// Add usage of some resources.
|
||||
project.GetPlatformSpecificAssets().Set(
|
||||
"android", "some-icon", "Resource1");
|
||||
project.GetPlatformSpecificAssets().Set(
|
||||
"android", "some-other-icon", "Resource2");
|
||||
|
||||
project.ExposeResources(resourcesRenamer);
|
||||
|
||||
// Check that resources were renamed were used.
|
||||
REQUIRE(project.GetPlatformSpecificAssets().Get("android", "some-icon") ==
|
||||
"RenamedResource1");
|
||||
REQUIRE(project.GetPlatformSpecificAssets().Get(
|
||||
"android", "some-other-icon") == "Resource2");
|
||||
}
|
||||
|
||||
SECTION("It renames embedded resources") {
|
||||
std::map<gd::String, gd::String> renamings = {
|
||||
{"Resource1", "RenamedResource1"}};
|
||||
gd::ResourcesRenamer resourcesRenamer(renamings);
|
||||
|
||||
gd::Project project;
|
||||
|
||||
// Add "classic", plain resources.
|
||||
gd::ImageResource resource1;
|
||||
resource1.SetName("Resource1");
|
||||
project.GetResourcesManager().AddResource(resource1);
|
||||
gd::ImageResource resource2;
|
||||
resource2.SetName("Resource2");
|
||||
project.GetResourcesManager().AddResource(resource2);
|
||||
|
||||
// Add a resource containing a mapping to other resources.
|
||||
gd::JsonResource jsonResourceWithEmbeddeds;
|
||||
jsonResourceWithEmbeddeds.SetName("Resource3");
|
||||
jsonResourceWithEmbeddeds.SetMetadata(
|
||||
"{ \"embeddedResourcesMapping\": {\"some-resource-name\": "
|
||||
"\"Resource1\", \"some-other-resource-name\": \"Resource2\"} }");
|
||||
project.GetResourcesManager().AddResource(jsonResourceWithEmbeddeds);
|
||||
|
||||
// Add usage of some resources.
|
||||
project.GetPlatformSpecificAssets().Set(
|
||||
"android", "some-icon", "Resource1");
|
||||
project.GetPlatformSpecificAssets().Set(
|
||||
"android", "some-other-icon", "Resource2");
|
||||
|
||||
project.ExposeResources(resourcesRenamer);
|
||||
|
||||
// TODO: This should not be necessary, but for now not all resources support embeddeds,
|
||||
// so we must call it manually:
|
||||
gd::String resource3Name = "Resource3";
|
||||
resourcesRenamer.ExposeEmbeddeds(resource3Name);
|
||||
|
||||
// Check that resources were renamed were used.
|
||||
REQUIRE(project.GetPlatformSpecificAssets().Get("android", "some-icon") ==
|
||||
"RenamedResource1");
|
||||
REQUIRE(project.GetPlatformSpecificAssets().Get(
|
||||
"android", "some-other-icon") == "Resource2");
|
||||
|
||||
// Check that the names were also updated in the embedded resources mapping.
|
||||
REQUIRE(project.GetResourcesManager().HasResource("Resource3") == true);
|
||||
REQUIRE(
|
||||
project.GetResourcesManager().GetResource("Resource3").GetMetadata() ==
|
||||
"{\"embeddedResourcesMapping\":{\"some-resource-name\":"
|
||||
"\"RenamedResource1\",\"some-other-resource-name\":\"Resource2\"}}");
|
||||
}
|
||||
}
|
||||
|
@@ -19,8 +19,6 @@
|
||||
import { type ObjectsRenderingService, type ObjectsEditorService } from '../JsExtensionTypes.flow.js'
|
||||
*/
|
||||
|
||||
const stringifyOptions = (options) => '["' + options.join('","') + '"]';
|
||||
|
||||
module.exports = {
|
||||
createExtension: function (
|
||||
_ /*: (string) => string */,
|
||||
@@ -37,9 +35,8 @@ module.exports = {
|
||||
)
|
||||
.setExtensionHelpPath('/objects/bbtext')
|
||||
.setCategory('User interface');
|
||||
extension
|
||||
.addInstructionOrExpressionGroupMetadata(_('BBCode Text Object'))
|
||||
.setIcon('JsPlatform/Extensions/bbcode32.png');
|
||||
extension.addInstructionOrExpressionGroupMetadata(_("BBCode Text Object"))
|
||||
.setIcon("JsPlatform/Extensions/bbcode32.png");
|
||||
|
||||
var objectBBText = new gd.ObjectJsImplementation();
|
||||
// $FlowExpectedError
|
||||
@@ -198,10 +195,7 @@ module.exports = {
|
||||
.addParameter('object', objectName, objectName, false)
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName(`get${property.functionName}`);
|
||||
} else if (
|
||||
parameterType === 'string' ||
|
||||
parameterType === 'stringWithSelector'
|
||||
) {
|
||||
} else if (parameterType === 'string') {
|
||||
gdObject
|
||||
.addStrExpression(
|
||||
`Get${property.functionName}`,
|
||||
@@ -216,24 +210,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Add the action
|
||||
if (
|
||||
parameterType === 'number' ||
|
||||
parameterType === 'string' ||
|
||||
parameterType === 'stringWithSelector'
|
||||
) {
|
||||
const parameterOptions =
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
property.paramLabel
|
||||
);
|
||||
if (property.options) {
|
||||
parameterOptions.setTypeExtraInfo(
|
||||
stringifyOptions(property.options)
|
||||
);
|
||||
}
|
||||
if (parameterType === 'number' || parameterType === 'string') {
|
||||
const expressionType =
|
||||
parameterType === 'number' ? 'expression' : 'string';
|
||||
gdObject
|
||||
.addAction(
|
||||
`Set${property.functionName}`,
|
||||
property.instructionLabel,
|
||||
property.paramLabel,
|
||||
property.actionDescription,
|
||||
property.actionSentence,
|
||||
'',
|
||||
@@ -241,7 +224,7 @@ module.exports = {
|
||||
property.iconPath
|
||||
)
|
||||
.addParameter('object', objectName, objectName, false)
|
||||
.useStandardOperatorParameters(parameterType, parameterOptions)
|
||||
.useStandardOperatorParameters(parameterType)
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName(`set${property.functionName}`)
|
||||
.setGetter(`get${property.functionName}`);
|
||||
@@ -249,7 +232,7 @@ module.exports = {
|
||||
gdObject
|
||||
.addAction(
|
||||
`Set${property.functionName}`,
|
||||
property.instructionLabel,
|
||||
property.paramLabel,
|
||||
property.actionDescription,
|
||||
property.actionSentence,
|
||||
'',
|
||||
@@ -260,7 +243,9 @@ module.exports = {
|
||||
.addParameter(
|
||||
parameterType,
|
||||
property.paramLabel,
|
||||
'', // There should not be options for the property if it's not a stringWithSelector
|
||||
property.options
|
||||
? '["' + property.options.join('", "') + '"]'
|
||||
: '',
|
||||
false
|
||||
)
|
||||
.getCodeExtraInformation()
|
||||
@@ -269,24 +254,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Add condition
|
||||
if (
|
||||
parameterType === 'string' ||
|
||||
parameterType === 'number' ||
|
||||
parameterType === 'stringWithSelector'
|
||||
) {
|
||||
const parameterOptions =
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
property.paramLabel
|
||||
);
|
||||
if (property.options) {
|
||||
parameterOptions.setTypeExtraInfo(
|
||||
stringifyOptions(property.options)
|
||||
);
|
||||
}
|
||||
if (parameterType === 'string' || parameterType === 'number') {
|
||||
const propExpressionType =
|
||||
parameterType === 'string' ? 'string' : 'expression';
|
||||
gdObject
|
||||
.addCondition(
|
||||
`Is${property.functionName}`,
|
||||
property.instructionLabel,
|
||||
property.paramLabel,
|
||||
property.conditionDescription,
|
||||
property.conditionSentence,
|
||||
'',
|
||||
@@ -294,17 +268,14 @@ module.exports = {
|
||||
property.iconPath
|
||||
)
|
||||
.addParameter('object', objectName, objectName, false)
|
||||
.useStandardRelationalOperatorParameters(
|
||||
parameterType,
|
||||
parameterOptions
|
||||
)
|
||||
.useStandardRelationalOperatorParameters(parameterType)
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName(`get${property.functionName}`);
|
||||
} else if (parameterType === 'yesorno') {
|
||||
gdObject
|
||||
.addCondition(
|
||||
`Is${property.functionName}`,
|
||||
property.instructionLabel,
|
||||
property.paramLabel,
|
||||
property.conditionDescription,
|
||||
property.conditionSentence,
|
||||
'',
|
||||
@@ -323,8 +294,7 @@ module.exports = {
|
||||
functionName: 'BBText',
|
||||
iconPath: 'res/actions/text24_black.png',
|
||||
type: 'string',
|
||||
instructionLabel: _('BBCode text'),
|
||||
paramLabel: _('Text'),
|
||||
paramLabel: _('BBCode text'),
|
||||
conditionDescription: _('Compare the value of the BBCode text.'),
|
||||
conditionSentence: _('the BBCode text'),
|
||||
actionDescription: _('Set BBCode text'),
|
||||
@@ -336,8 +306,7 @@ module.exports = {
|
||||
functionName: 'Color',
|
||||
iconPath: 'res/actions/color24.png',
|
||||
type: 'color',
|
||||
instructionLabel: _('Color'),
|
||||
paramLabel: _('Color (R;G;B)'),
|
||||
paramLabel: _('Color'),
|
||||
conditionDescription: '', // No conditions for a "color" property
|
||||
conditionSentence: '', // No conditions for a "color" property
|
||||
actionDescription: _('Set base color'),
|
||||
@@ -349,8 +318,7 @@ module.exports = {
|
||||
functionName: 'Opacity',
|
||||
iconPath: 'res/actions/opacity24.png',
|
||||
type: 'number',
|
||||
instructionLabel: _('Opacity'),
|
||||
paramLabel: _('Opacity (0-255)'),
|
||||
paramLabel: _('Opacity'),
|
||||
conditionDescription: _(
|
||||
'Compare the value of the base opacity of the text.'
|
||||
),
|
||||
@@ -364,7 +332,6 @@ module.exports = {
|
||||
functionName: 'FontSize',
|
||||
iconPath: 'res/actions/characterSize24.png',
|
||||
type: 'number',
|
||||
instructionLabel: _('Font size'),
|
||||
paramLabel: _('Font size'),
|
||||
conditionDescription: _('Compare the base font size of the text.'),
|
||||
conditionSentence: _('the base font size'),
|
||||
@@ -377,7 +344,6 @@ module.exports = {
|
||||
functionName: 'FontFamily',
|
||||
iconPath: 'res/actions/font24.png',
|
||||
type: 'string',
|
||||
instructionLabel: _('Font family'),
|
||||
paramLabel: _('Font family'),
|
||||
conditionDescription: _('Compare the value of font family'),
|
||||
conditionSentence: _('the base font family'),
|
||||
@@ -390,7 +356,6 @@ module.exports = {
|
||||
functionName: 'Alignment',
|
||||
iconPath: 'res/actions/textAlign24.png',
|
||||
type: 'stringWithSelector',
|
||||
instructionLabel: _('Alignment'),
|
||||
paramLabel: _('Alignment'),
|
||||
options: ['left', 'right', 'center'],
|
||||
conditionDescription: _('Check the current text alignment.'),
|
||||
@@ -404,7 +369,6 @@ module.exports = {
|
||||
functionName: 'WordWrap',
|
||||
iconPath: 'res/actions/scaleWidth24_black.png',
|
||||
type: 'boolean',
|
||||
instructionLabel: _('Word wrap'),
|
||||
paramLabel: _('Word wrap'),
|
||||
conditionDescription: _('Check if word wrap is enabled.'),
|
||||
conditionSentence: _('Word wrap is enabled'),
|
||||
@@ -417,7 +381,6 @@ module.exports = {
|
||||
functionName: 'WrappingWidth',
|
||||
iconPath: 'res/actions/scaleWidth24_black.png',
|
||||
type: 'number',
|
||||
instructionLabel: _('Wrapping width'),
|
||||
paramLabel: _('Wrapping width'),
|
||||
conditionDescription: _(
|
||||
'Compare the width, in pixels, after which the text is wrapped on next line.'
|
||||
@@ -547,7 +510,8 @@ module.exports = {
|
||||
* This is called to update the PIXI object on the scene editor
|
||||
*/
|
||||
RenderedBBTextInstance.prototype.update = function () {
|
||||
const properties = this._associatedObjectConfiguration.getProperties();
|
||||
const properties = this._associatedObjectConfiguration
|
||||
.getProperties();
|
||||
|
||||
const rawText = properties.get('text').getValue();
|
||||
if (rawText !== this._pixiObject.text) {
|
||||
|
@@ -187,7 +187,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters('string', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('setText')
|
||||
.setGetter('getText');
|
||||
|
||||
@@ -202,12 +202,7 @@ module.exports = {
|
||||
'res/conditions/opacity24.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Opacity (0-255)')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setOpacity')
|
||||
.setGetter('getOpacity');
|
||||
|
||||
@@ -222,7 +217,7 @@ module.exports = {
|
||||
'res/conditions/characterSize24.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('getFontSize');
|
||||
|
||||
object
|
||||
@@ -236,12 +231,7 @@ module.exports = {
|
||||
'res/actions/scale24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Scale (1 by default)')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setScale')
|
||||
.setGetter('getScale');
|
||||
|
||||
@@ -256,7 +246,7 @@ module.exports = {
|
||||
'res/conditions/font24.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters('string', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('getFontName');
|
||||
|
||||
object
|
||||
@@ -314,12 +304,7 @@ module.exports = {
|
||||
'res/actions/textAlign24.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters(
|
||||
'string',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Alignment ("left", "right" or "center")')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('getAlignment');
|
||||
|
||||
object
|
||||
@@ -382,7 +367,7 @@ module.exports = {
|
||||
'res/actions/scaleWidth24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Bitmap text'), 'BitmapTextObject', false)
|
||||
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setWrappingWidth')
|
||||
.setGetter('getWrappingWidth');
|
||||
|
||||
|
@@ -45,8 +45,7 @@ void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/destroyoutsideicon16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "DestroyOutside")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetExtraBorder");
|
||||
|
||||
@@ -60,8 +59,7 @@ void DeclareDestroyOutsideBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/destroyoutsideicon16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "DestroyOutside")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetExtraBorder")
|
||||
.SetGetter("GetExtraBorder");
|
||||
|
@@ -28,7 +28,7 @@ module.exports = {
|
||||
extension
|
||||
.setExtensionInformation(
|
||||
'DialogueTree',
|
||||
_('Dialogue Tree'),
|
||||
_('Dialogue Tree (experimental)'),
|
||||
'Handle dialogue trees, made using Yarn Spinner. Useful to make complex dialogues with multiple choices. The Yarn Spinner editor is embedded in GDevelop so you can edit your dialogues without leaving GDevelop.',
|
||||
'Todor Imreorov',
|
||||
'Open source (MIT License)'
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
.setExtensionHelpPath('/all-features/dialogue-tree')
|
||||
.setCategory('Game mechanic');
|
||||
extension
|
||||
.addInstructionOrExpressionGroupMetadata(_('Dialogue Tree'))
|
||||
.addInstructionOrExpressionGroupMetadata(_('Dialogue Tree (experimental)'))
|
||||
.setIcon('JsPlatform/Extensions/yarn32.png');
|
||||
|
||||
extension
|
||||
|
@@ -64,8 +64,7 @@ void DeclareInventoryExtension(gd::PlatformExtension& extension) {
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.AddParameter("string", _("Inventory name"))
|
||||
.AddParameter("string", _("Item name"))
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("InventoryTools::Count");
|
||||
|
||||
extension
|
||||
|
@@ -28,14 +28,14 @@ module.exports = {
|
||||
extension
|
||||
.setExtensionInformation(
|
||||
'Leaderboards',
|
||||
_('Leaderboards'),
|
||||
_('Leaderboards (experimental)'),
|
||||
_('Allow your game to send scores to your leaderboards.'),
|
||||
'Florian Rival',
|
||||
'Open source (MIT License)'
|
||||
)
|
||||
.setExtensionHelpPath('/all-features/leaderboards')
|
||||
.setCategory('Players')
|
||||
.addInstructionOrExpressionGroupMetadata(_('Leaderboards'))
|
||||
.addInstructionOrExpressionGroupMetadata(_('Leaderboards (experimental)'))
|
||||
.setIcon('JsPlatform/Extensions/leaderboard.svg');
|
||||
|
||||
extension
|
||||
|
@@ -28,7 +28,7 @@ module.exports = {
|
||||
extension
|
||||
.setExtensionInformation(
|
||||
'P2P',
|
||||
_('P2P'),
|
||||
_('P2P (experimental)'),
|
||||
'Allow game instances to communicate remotely using messages sent via WebRTC (P2P).',
|
||||
'Arthur Pacaud (arthuro555)',
|
||||
'MIT'
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
.setExtensionHelpPath('/all-features/p2p')
|
||||
.setCategory('Network');
|
||||
extension
|
||||
.addInstructionOrExpressionGroupMetadata(_('P2P'))
|
||||
.addInstructionOrExpressionGroupMetadata(_('P2P (experimental)'))
|
||||
.setIcon('JsPlatform/Extensions/p2picon.svg');
|
||||
|
||||
extension
|
||||
|
@@ -24,9 +24,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"Victor Levasseur and Florian Rival",
|
||||
"Open source (MIT License)")
|
||||
.SetExtensionHelpPath("/objects/panel_sprite");
|
||||
extension
|
||||
.AddInstructionOrExpressionGroupMetadata(
|
||||
_("Panel Sprite (9-patch) Object"))
|
||||
extension.AddInstructionOrExpressionGroupMetadata(_("Panel Sprite (9-patch) Object"))
|
||||
.SetIcon("CppPlatform/Extensions/PanelSpriteIcon.png");
|
||||
|
||||
gd::ObjectMetadata& obj =
|
||||
@@ -50,10 +48,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction(
|
||||
"SetOpacity",
|
||||
@@ -66,10 +61,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddExpression("Opacity",
|
||||
_("Opacity"),
|
||||
@@ -99,8 +91,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetWidth")
|
||||
.SetGetter("GetWidth");
|
||||
|
||||
@@ -113,8 +104,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetWidth");
|
||||
|
||||
obj.AddAction("Height",
|
||||
@@ -126,8 +116,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetHeight")
|
||||
.SetGetter("GetHeight");
|
||||
|
||||
@@ -140,8 +129,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("SetHeight")
|
||||
.SetGetter("GetHeight");
|
||||
|
||||
@@ -155,10 +143,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.SetHidden() // Deprecated
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetAngle")
|
||||
.SetGetter("GetAngle");
|
||||
|
||||
@@ -172,10 +157,7 @@ void DeclarePanelSpriteObjectExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.SetHidden() // Deprecated
|
||||
.AddParameter("object", _("Object"), "PanelSprite")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("SetAngle")
|
||||
.SetGetter("GetAngle");
|
||||
|
||||
|
@@ -54,8 +54,7 @@ void PanelSpriteObject::DoSerializeTo(gd::SerializerElement& element) const {
|
||||
element.SetAttribute("tiled", tiled);
|
||||
}
|
||||
|
||||
void PanelSpriteObject::ExposeResources(
|
||||
gd::ArbitraryResourceWorker& worker) {
|
||||
void PanelSpriteObject::ExposeResources(gd::ArbitraryResourceWorker& worker) {
|
||||
worker.ExposeImage(textureName);
|
||||
}
|
||||
#endif
|
||||
|
@@ -8,13 +8,12 @@ This project is released under the MIT License.
|
||||
#ifndef PANELSPRITEOBJECT_H
|
||||
#define PANELSPRITEOBJECT_H
|
||||
#include <memory>
|
||||
|
||||
#include "GDCore/Project/Object.h"
|
||||
namespace gd {
|
||||
class ObjectConfiguration;
|
||||
class InitialInstance;
|
||||
class Project;
|
||||
} // namespace gd
|
||||
}
|
||||
|
||||
/**
|
||||
* PanelSprite Object
|
||||
@@ -24,36 +23,37 @@ class GD_EXTENSION_API PanelSpriteObject : public gd::ObjectConfiguration {
|
||||
PanelSpriteObject();
|
||||
virtual ~PanelSpriteObject();
|
||||
virtual std::unique_ptr<gd::ObjectConfiguration> Clone() const {
|
||||
return std::unique_ptr<gd::ObjectConfiguration>(
|
||||
new PanelSpriteObject(*this));
|
||||
return std::unique_ptr<gd::ObjectConfiguration>(new PanelSpriteObject(*this));
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
virtual void ExposeResources(gd::ArbitraryResourceWorker &worker);
|
||||
#endif
|
||||
|
||||
double GetWidth() const { return width; };
|
||||
double GetHeight() const { return height; };
|
||||
float GetWidth() const { return width; };
|
||||
float GetHeight() const { return height; };
|
||||
|
||||
void SetWidth(double newWidth) {
|
||||
void SetWidth(float newWidth) {
|
||||
width = newWidth >= (leftMargin + rightMargin) ? newWidth
|
||||
: (leftMargin + rightMargin);
|
||||
};
|
||||
void SetHeight(double newHeight) {
|
||||
void SetHeight(float newHeight) {
|
||||
height = newHeight >= (topMargin + bottomMargin)
|
||||
? newHeight
|
||||
: (topMargin + bottomMargin);
|
||||
};
|
||||
|
||||
double GetLeftMargin() const { return leftMargin; };
|
||||
void SetLeftMargin(double newMargin) { leftMargin = newMargin; };
|
||||
float GetLeftMargin() const { return leftMargin; };
|
||||
void SetLeftMargin(float newMargin) { leftMargin = newMargin; };
|
||||
|
||||
double GetTopMargin() const { return topMargin; };
|
||||
void SetTopMargin(double newMargin) { topMargin = newMargin; };
|
||||
float GetTopMargin() const { return topMargin; };
|
||||
void SetTopMargin(float newMargin) { topMargin = newMargin; };
|
||||
|
||||
double GetRightMargin() const { return rightMargin; };
|
||||
void SetRightMargin(double newMargin) { rightMargin = newMargin; };
|
||||
float GetRightMargin() const { return rightMargin; };
|
||||
void SetRightMargin(float newMargin) { rightMargin = newMargin; };
|
||||
|
||||
double GetBottomMargin() const { return bottomMargin; };
|
||||
void SetBottomMargin(double newMargin) { bottomMargin = newMargin; };
|
||||
float GetBottomMargin() const { return bottomMargin; };
|
||||
void SetBottomMargin(float newMargin) { bottomMargin = newMargin; };
|
||||
|
||||
bool IsTiled() const { return tiled; };
|
||||
void SetTiled(bool enable = true) { tiled = enable; };
|
||||
@@ -72,13 +72,13 @@ class GD_EXTENSION_API PanelSpriteObject : public gd::ObjectConfiguration {
|
||||
virtual void DoSerializeTo(gd::SerializerElement &element) const;
|
||||
#endif
|
||||
|
||||
double width;
|
||||
double height;
|
||||
float width;
|
||||
float height;
|
||||
|
||||
double leftMargin;
|
||||
double topMargin;
|
||||
double rightMargin;
|
||||
double bottomMargin;
|
||||
float leftMargin;
|
||||
float topMargin;
|
||||
float rightMargin;
|
||||
float bottomMargin;
|
||||
|
||||
bool tiled;
|
||||
};
|
||||
|
@@ -5,9 +5,10 @@ Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "Extension.h"
|
||||
#include "GDCore/Extensions/PlatformExtension.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
|
||||
#include "Extension.h"
|
||||
#include "ParticleEmitterObject.h"
|
||||
|
||||
/**
|
||||
@@ -22,8 +23,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("EmitterForceMax",
|
||||
_("Emission maximal force"),
|
||||
@@ -33,8 +33,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("EmitterAngle",
|
||||
_("Emission angle"),
|
||||
@@ -44,10 +43,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("EmitterAngle",
|
||||
_("Emission angle"),
|
||||
@@ -57,10 +53,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("EmitterAngleA",
|
||||
_("Emission angle 1"),
|
||||
@@ -70,9 +63,8 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.SetHidden(); // Angle A is not used.
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetHidden(); // Angle A is not used.
|
||||
|
||||
obj.AddCondition("EmitterAngleA",
|
||||
_("Emission angle 1"),
|
||||
@@ -82,9 +74,8 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.SetHidden(); // Angle A is not used.
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetHidden(); // Angle A is not used.
|
||||
|
||||
obj.AddAction("EmitterAngleB",
|
||||
_("Emission angle 2"),
|
||||
@@ -94,9 +85,8 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.SetHidden(); // Angle B is the same as cone spray angle
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetHidden(); // Angle B is the same as cone spray angle
|
||||
|
||||
obj.AddCondition("EmitterAngleB",
|
||||
_("Emission angle 2"),
|
||||
@@ -106,9 +96,8 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.SetHidden(); // Angle B is the same as cone spray angle
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetHidden(); // Angle B is the same as cone spray angle
|
||||
|
||||
obj.AddAction(
|
||||
"ConeSprayAngle",
|
||||
@@ -119,10 +108,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ConeSprayAngle",
|
||||
_("Angle of the spray cone"),
|
||||
@@ -132,10 +118,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ZoneRadius",
|
||||
_("Creation radius"),
|
||||
@@ -146,8 +129,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ZoneRadius",
|
||||
_("Creation radius"),
|
||||
@@ -157,23 +139,19 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction(
|
||||
"ParticleLifeTimeMin",
|
||||
_("Minimum lifetime"),
|
||||
_("Modify particles minimum lifetime. Particles have to be recreated "
|
||||
_("Modify particles minimum lifetime.Particles have to be recreated "
|
||||
"in order to take changes in account."),
|
||||
_("the minimum lifetime of particles"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration (in seconds)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition(
|
||||
"ParticleLifeTimeMin",
|
||||
@@ -184,10 +162,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration to compare to (in seconds)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction(
|
||||
"ParticleLifeTimeMax",
|
||||
@@ -199,10 +174,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration (in seconds)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition(
|
||||
"ParticleLifeTimeMax",
|
||||
@@ -213,10 +185,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration to compare to (in seconds)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGravityX",
|
||||
_("Gravity value on X axis"),
|
||||
@@ -226,8 +195,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition(
|
||||
"ParticleGravityX",
|
||||
@@ -238,8 +206,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGravityY",
|
||||
_("Gravity value on Y axis"),
|
||||
@@ -249,8 +216,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition(
|
||||
"ParticleGravityY",
|
||||
@@ -261,8 +227,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGravityAngle",
|
||||
_("Gravity angle"),
|
||||
@@ -272,10 +237,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleGravityAngle",
|
||||
_("Gravity angle"),
|
||||
@@ -285,10 +247,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGravityLength",
|
||||
_("Gravity"),
|
||||
@@ -298,8 +257,7 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleGravityLength",
|
||||
_("Gravity"),
|
||||
@@ -309,13 +267,11 @@ void ExtensionSubDeclaration1(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("StartEmission",
|
||||
_("Start emission"),
|
||||
_("Refill tank (if not infinite) and start emission of the "
|
||||
"particles."),
|
||||
_("Refill tank (if not infinite) and start emission of the particles."),
|
||||
_("Start emission of _PARAM0_"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
|
@@ -5,10 +5,11 @@ Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "Extension.h"
|
||||
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
|
||||
#include "GDCore/Extensions/PlatformExtension.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
|
||||
|
||||
#include "Extension.h"
|
||||
#include "ParticleEmitterObject.h"
|
||||
|
||||
/**
|
||||
@@ -35,161 +36,137 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.AddParameter("color", _("End color"));
|
||||
|
||||
obj.AddAction("ParticleRed1",
|
||||
_("Start color red component"),
|
||||
_("Modify the start color red component."),
|
||||
_("the start color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleRed1",
|
||||
_("Start color red component"),
|
||||
_("Modify the start color red component."),
|
||||
_("the start color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleRed1",
|
||||
_("Start color red component"),
|
||||
_("Compare the start color red component."),
|
||||
_("the start color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleRed1",
|
||||
_("Start color red component"),
|
||||
_("Compare the start color red component."),
|
||||
_("the start color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleRed2",
|
||||
_("End color red component"),
|
||||
_("Modify the end color red component."),
|
||||
_("the end color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleRed2",
|
||||
_("End color red component"),
|
||||
_("Modify the end color red component."),
|
||||
_("the end color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleRed2",
|
||||
_("End color red component"),
|
||||
_("Compare the end color red component."),
|
||||
_("the end color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleRed2",
|
||||
_("End color red component"),
|
||||
_("Compare the end color red component."),
|
||||
_("the end color red component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleBlue1",
|
||||
_("Start color blue component"),
|
||||
_("Modify the start color blue component."),
|
||||
_("the start color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleBlue1",
|
||||
_("Start color blue component"),
|
||||
_("Modify the start color blue component."),
|
||||
_("the start color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleBlue1",
|
||||
_("Start color blue component"),
|
||||
_("Compare the start color blue component."),
|
||||
_("the start color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleBlue1",
|
||||
_("Start color blue component"),
|
||||
_("Compare the start color blue component."),
|
||||
_("the start color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleBlue2",
|
||||
_("End color blue component"),
|
||||
_("Modify the end color blue component."),
|
||||
_("the end color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleBlue2",
|
||||
_("End color blue component"),
|
||||
_("Modify the end color blue component."),
|
||||
_("the end color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleBlue2",
|
||||
_("End color blue component"),
|
||||
_("Compare the end color blue component."),
|
||||
_("the end color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleBlue2",
|
||||
_("End color blue component"),
|
||||
_("Compare the end color blue component."),
|
||||
_("the end color blue component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGreen1",
|
||||
_("Start color green component"),
|
||||
_("Modify the start color green component."),
|
||||
_("the start color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleGreen1",
|
||||
_("Start color green component"),
|
||||
_("Modify the start color green component."),
|
||||
_("the start color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleGreen1",
|
||||
_("Start color green component"),
|
||||
_("Compare the start color green component."),
|
||||
_("the start color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleGreen1",
|
||||
_("Start color green component"),
|
||||
_("Compare the start color green component."),
|
||||
_("the start color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleGreen2",
|
||||
_("End color green component"),
|
||||
_("Modify the end color green component."),
|
||||
_("the end color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddAction(
|
||||
"ParticleGreen2",
|
||||
_("End color green component"),
|
||||
_("Modify the end color green component."),
|
||||
_("the end color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleGreen2",
|
||||
_("End color green component"),
|
||||
_("Compare the end color green component."),
|
||||
_("the end color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleGreen2",
|
||||
_("End color green component"),
|
||||
_("Compare the end color green component."),
|
||||
_("the end color green component"),
|
||||
_("Advanced"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleSize1",
|
||||
_("Start size"),
|
||||
@@ -199,8 +176,7 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleSize1",
|
||||
_("Start size"),
|
||||
@@ -210,8 +186,7 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleSize2",
|
||||
_("End size"),
|
||||
@@ -221,8 +196,7 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleSize2",
|
||||
_("End size"),
|
||||
@@ -232,8 +206,7 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleAlpha1",
|
||||
_("Start opacity"),
|
||||
@@ -243,23 +216,18 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleAlpha1",
|
||||
_("Start opacity"),
|
||||
_("Compare the start opacity of particles."),
|
||||
_("the start opacity"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleAlpha1",
|
||||
_("Start opacity"),
|
||||
_("Compare the start opacity of particles."),
|
||||
_("the start opacity"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("ParticleAlpha2",
|
||||
_("End opacity"),
|
||||
@@ -269,23 +237,18 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value (0-255)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("ParticleAlpha2",
|
||||
_("End opacity"),
|
||||
_("Compare the end opacity of particles."),
|
||||
_("the end opacity"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"ParticleAlpha2",
|
||||
_("End opacity"),
|
||||
_("Compare the end opacity of particles."),
|
||||
_("the end opacity"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Value to compare to (0-255)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("NoMoreParticles",
|
||||
_("No more particles"),
|
||||
@@ -298,63 +261,58 @@ void ExtensionSubDeclaration2(gd::ObjectMetadata& obj) {
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter");
|
||||
|
||||
obj.AddExpressionAndConditionAndAction(
|
||||
"number",
|
||||
"ParticleRotationMinSpeed",
|
||||
_("Particle rotation min speed"),
|
||||
_("the minimum rotation speed of the particles"),
|
||||
_("the particles minimum rotation speed"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angular speed (in degrees per second)")))
|
||||
"ParticleRotationMinSpeed",
|
||||
_("Particle rotation min speed"),
|
||||
_("the minimum rotation speed of the particles"),
|
||||
_("the particles minimum rotation speed"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("setParticleRotationMinSpeed")
|
||||
.SetGetter("getParticleRotationMinSpeed");
|
||||
|
||||
obj.AddExpressionAndConditionAndAction(
|
||||
"number",
|
||||
"ParticleRotationMaxSpeed",
|
||||
_("Particle rotation max speed"),
|
||||
_("the maximum rotation speed of the particles"),
|
||||
_("the particles maximum rotation speed"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angular speed (in degrees per second)")))
|
||||
"ParticleRotationMaxSpeed",
|
||||
_("Particle rotation max speed"),
|
||||
_("the maximum rotation speed of the particles"),
|
||||
_("the particles maximum rotation speed"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("setParticleRotationMaxSpeed")
|
||||
.SetGetter("getParticleRotationMaxSpeed");
|
||||
|
||||
obj.AddExpressionAndConditionAndAction(
|
||||
"number",
|
||||
"MaxParticlesCount",
|
||||
_("Number of displayed particles"),
|
||||
_("the maximum number of displayed particles"),
|
||||
_("the maximum number of displayed particles"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
"number",
|
||||
"MaxParticlesCount",
|
||||
_("Number of displayed particles"),
|
||||
_("the maximum number of displayed particles"),
|
||||
_("the maximum number of displayed particles"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters("number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("number")
|
||||
.SetFunctionName("setMaxParticlesCount")
|
||||
.SetGetter("getMaxParticlesCount");
|
||||
|
||||
obj.AddExpressionAndConditionAndAction(
|
||||
"boolean",
|
||||
"AdditiveRendering",
|
||||
_("Activate particles additive rendering"),
|
||||
_("the particles additive rendering is activated"),
|
||||
_("displaying particles with additive rendering activated"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
"boolean",
|
||||
"AdditiveRendering",
|
||||
_("Activate particles additive rendering"),
|
||||
_("the particles additive rendering is activated"),
|
||||
_("displaying particles with additive rendering activated"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardParameters("boolean", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardParameters("boolean")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("setAdditiveRendering")
|
||||
.SetGetter("getAdditiveRendering");
|
||||
|
||||
}
|
||||
|
@@ -34,20 +34,19 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("RendererParam1",
|
||||
_("Rendering first parameter"),
|
||||
_("Test the first parameter of rendering (Size/Length)."),
|
||||
_("the 1st rendering parameter"),
|
||||
_("Setup"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"RendererParam1",
|
||||
_("Rendering first parameter"),
|
||||
_("Test the first parameter of rendering (Size/Length)."),
|
||||
_("the 1st rendering parameter"),
|
||||
_("Setup"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("RendererParam2",
|
||||
_("Rendering second parameter"),
|
||||
@@ -59,19 +58,18 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("RendererParam2",
|
||||
_("Rendering second parameter"),
|
||||
_("Test the second parameter of rendering (Size/Length)."),
|
||||
_("the 2nd rendering parameter"),
|
||||
_("Setup"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"RendererParam2",
|
||||
_("Rendering second parameter"),
|
||||
_("Test the second parameter of rendering (Size/Length)."),
|
||||
_("the 2nd rendering parameter"),
|
||||
_("Setup"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("Tank",
|
||||
_("Capacity"),
|
||||
@@ -81,9 +79,8 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.SetHidden() // DEPRECATED - Use SetTank instead
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.SetHidden() // DEPRECATED - Use SetTank instead
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("SetTank",
|
||||
_("Capacity"),
|
||||
@@ -93,9 +90,7 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(_("Capacity")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("Tank",
|
||||
_("Capacity"),
|
||||
@@ -105,10 +100,7 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Capacity to compare to")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("Flow",
|
||||
_("Flow"),
|
||||
@@ -118,9 +110,8 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.SetHidden() // DEPRECATED - Use SetFlow instead
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.SetHidden() // DEPRECATED - Use SetFlow instead
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("SetFlow",
|
||||
_("Flow"),
|
||||
@@ -130,10 +121,7 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Flow (in particles per second)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("Flow",
|
||||
_("Flow"),
|
||||
@@ -143,10 +131,7 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Flow to compare to (in particles per second)")));
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("Texture",
|
||||
_("Particle image (using an expression)"),
|
||||
@@ -169,16 +154,16 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.AddParameter("imageResource", _("Image file (or image resource name)"));
|
||||
|
||||
obj.AddCondition("Texture",
|
||||
_("Image"),
|
||||
_("Test the name of the image displayed by particles."),
|
||||
_("the image displayed by particles"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
obj.AddCondition(
|
||||
"Texture",
|
||||
_("Image"),
|
||||
_("Test the name of the image displayed by particles."),
|
||||
_("the image displayed by particles"),
|
||||
_("Common"),
|
||||
"CppPlatform/Extensions/particleSystemicon24.png",
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("string");
|
||||
|
||||
obj.AddStrExpression("Texture",
|
||||
_("Particles image"),
|
||||
@@ -192,7 +177,7 @@ void ExtensionSubDeclaration3(gd::ObjectMetadata& obj) {
|
||||
_("Particles number"),
|
||||
_("Particles"),
|
||||
"CppPlatform/Extensions/particleSystemicon16.png")
|
||||
.SetHidden() // DEPRECATED - Use CurrentParticleCount instead
|
||||
.SetHidden() // DEPRECATED - Use CurrentParticleCount instead
|
||||
.AddParameter("object", _("Object"), "ParticleEmitter", false);
|
||||
|
||||
obj.AddExpression("CurrentParticleCount",
|
||||
|
@@ -5,15 +5,16 @@ Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "ParticleEmitterObject.h"
|
||||
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
|
||||
#include "GDCore/Project/InitialInstance.h"
|
||||
#include "GDCore/Project/Object.h"
|
||||
#include "GDCore/Project/Project.h"
|
||||
#include "GDCore/Serialization/SerializerElement.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "ParticleEmitterObject.h"
|
||||
|
||||
#include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
|
||||
#include "GDCore/CommonTools.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -177,49 +178,53 @@ void ParticleEmitterObject::ExposeResources(
|
||||
SetParticleTexture(texture);
|
||||
}
|
||||
|
||||
void ParticleEmitterBase::SetTank(double newValue) { tank = newValue; }
|
||||
void ParticleEmitterBase::SetFlow(double newValue) { flow = newValue; }
|
||||
void ParticleEmitterBase::SetEmitterForceMin(double newValue) {
|
||||
void ParticleEmitterBase::SetTank(float newValue) {
|
||||
tank = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetFlow(float newValue) {
|
||||
flow = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetEmitterForceMin(float newValue) {
|
||||
emitterForceMin = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetEmitterForceMax(double newValue) {
|
||||
void ParticleEmitterBase::SetEmitterForceMax(float newValue) {
|
||||
emitterForceMax = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetParticleGravityX(double newValue) {
|
||||
void ParticleEmitterBase::SetParticleGravityX(float newValue) {
|
||||
particleGravityX = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetParticleGravityY(double newValue) {
|
||||
void ParticleEmitterBase::SetParticleGravityY(float newValue) {
|
||||
particleGravityY = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetEmitterAngleA(double newValue) {
|
||||
void ParticleEmitterBase::SetEmitterAngleA(float newValue) {
|
||||
emitterAngleA = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetEmitterAngleB(double newValue) {
|
||||
void ParticleEmitterBase::SetEmitterAngleB(float newValue) {
|
||||
emitterAngleB = newValue;
|
||||
}
|
||||
void ParticleEmitterBase::SetZoneRadius(double newValue) {
|
||||
void ParticleEmitterBase::SetZoneRadius(float newValue) {
|
||||
zoneRadius = newValue;
|
||||
}
|
||||
|
||||
void ParticleEmitterBase::SetParticleGravityAngle(double newAngleInDegree) {
|
||||
double length = sqrt(GetParticleGravityY() * GetParticleGravityY() +
|
||||
GetParticleGravityX() * GetParticleGravityX());
|
||||
void ParticleEmitterBase::SetParticleGravityAngle(float newAngleInDegree) {
|
||||
float length = sqrt(GetParticleGravityY() * GetParticleGravityY() +
|
||||
GetParticleGravityX() * GetParticleGravityX());
|
||||
|
||||
SetParticleGravityX(cos(newAngleInDegree / 180.0f * 3.14159f) * length);
|
||||
SetParticleGravityY(sin(newAngleInDegree / 180.0f * 3.14159f) * length);
|
||||
}
|
||||
void ParticleEmitterBase::SetParticleGravityLength(double length) {
|
||||
double angle = atan2(GetParticleGravityY(), GetParticleGravityX());
|
||||
void ParticleEmitterBase::SetParticleGravityLength(float length) {
|
||||
float angle = atan2(GetParticleGravityY(), GetParticleGravityX());
|
||||
|
||||
SetParticleGravityX(cos(angle) * length);
|
||||
SetParticleGravityY(sin(angle) * length);
|
||||
}
|
||||
|
||||
double ParticleEmitterBase::GetParticleGravityAngle() const {
|
||||
float ParticleEmitterBase::GetParticleGravityAngle() const {
|
||||
return atan2(GetParticleGravityY(), GetParticleGravityX()) * 180.0f /
|
||||
3.14159f;
|
||||
}
|
||||
double ParticleEmitterBase::GetParticleGravityLength() const {
|
||||
float ParticleEmitterBase::GetParticleGravityLength() const {
|
||||
return sqrt(GetParticleGravityY() * GetParticleGravityY() +
|
||||
GetParticleGravityX() * GetParticleGravityX());
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ This project is released under the MIT License.
|
||||
namespace gd {
|
||||
class InitialInstance;
|
||||
class Project;
|
||||
} // namespace gd
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Base class containing the parameters of an emitter as well as the
|
||||
@@ -22,69 +22,95 @@ class GD_EXTENSION_API ParticleEmitterBase {
|
||||
public:
|
||||
ParticleEmitterBase();
|
||||
virtual ~ParticleEmitterBase();
|
||||
ParticleEmitterBase(const ParticleEmitterBase& other) { Init(other); };
|
||||
ParticleEmitterBase(const ParticleEmitterBase& other) {
|
||||
Init(other);
|
||||
};
|
||||
ParticleEmitterBase& operator=(const ParticleEmitterBase& other) {
|
||||
if (&other != this) Init(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void SetParticleTexture(const gd::String& imageName) {
|
||||
void SetParticleTexture(const gd::String & imageName) {
|
||||
textureParticleName = imageName;
|
||||
};
|
||||
const gd::String& GetParticleTexture() const { return textureParticleName; };
|
||||
const gd::String & GetParticleTexture() const { return textureParticleName; };
|
||||
|
||||
void SetRendererParam1(double newValue) { rendererParam1 = newValue; };
|
||||
void SetRendererParam2(double newValue) { rendererParam2 = newValue; };
|
||||
void SetTank(double newValue);
|
||||
void SetFlow(double newValue);
|
||||
void SetEmitterForceMin(double newValue);
|
||||
void SetEmitterForceMax(double newValue);
|
||||
void SetEmitterAngleA(double newValue);
|
||||
void SetEmitterAngleB(double newValue);
|
||||
void SetConeSprayAngle(double newValue) { SetEmitterAngleB(newValue); };
|
||||
void SetZoneRadius(double newValue);
|
||||
void SetParticleGravityX(double newValue);
|
||||
void SetParticleGravityY(double newValue);
|
||||
void SetParticleGravityAngle(double newAngleInDegree);
|
||||
void SetParticleGravityLength(double newLength);
|
||||
void SetRendererParam1(float newValue) { rendererParam1 = newValue; };
|
||||
void SetRendererParam2(float newValue) { rendererParam2 = newValue; };
|
||||
void SetTank(float newValue);
|
||||
void SetFlow(float newValue);
|
||||
void SetEmitterForceMin(float newValue);
|
||||
void SetEmitterForceMax(float newValue);
|
||||
void SetEmitterAngleA(float newValue);
|
||||
void SetEmitterAngleB(float newValue);
|
||||
void SetConeSprayAngle(float newValue) { SetEmitterAngleB(newValue); };
|
||||
void SetZoneRadius(float newValue);
|
||||
void SetParticleGravityX(float newValue);
|
||||
void SetParticleGravityY(float newValue);
|
||||
void SetParticleGravityAngle(float newAngleInDegree);
|
||||
void SetParticleGravityLength(float newLength);
|
||||
|
||||
void SetParticleColor1(const gd::String& color);
|
||||
void SetParticleColor2(const gd::String& color);
|
||||
|
||||
void SetParticleRed1(double newValue) { particleRed1 = newValue; };
|
||||
void SetParticleRed2(double newValue) { particleRed2 = newValue; };
|
||||
void SetParticleGreen1(double newValue) { particleGreen1 = newValue; };
|
||||
void SetParticleGreen2(double newValue) { particleGreen2 = newValue; };
|
||||
void SetParticleBlue1(double newValue) { particleBlue1 = newValue; };
|
||||
void SetParticleBlue2(double newValue) { particleBlue2 = newValue; };
|
||||
void SetParticleAlpha1(double newValue) { particleAlpha1 = newValue; };
|
||||
void SetParticleAlpha2(double newValue) { particleAlpha2 = newValue; };
|
||||
void SetParticleSize1(double newValue) { particleSize1 = newValue; };
|
||||
void SetParticleSize2(double newValue) { particleSize2 = newValue; };
|
||||
void SetParticleAngle1(double newValue) { particleAngle1 = newValue; };
|
||||
void SetParticleAngle2(double newValue) { particleAngle2 = newValue; };
|
||||
void SetParticleAlphaRandomness1(double newValue) {
|
||||
void SetParticleRed1(float newValue) {
|
||||
particleRed1 = newValue;
|
||||
};
|
||||
void SetParticleRed2(float newValue) {
|
||||
particleRed2 = newValue;
|
||||
};
|
||||
void SetParticleGreen1(float newValue) {
|
||||
particleGreen1 = newValue;
|
||||
};
|
||||
void SetParticleGreen2(float newValue) {
|
||||
particleGreen2 = newValue;
|
||||
};
|
||||
void SetParticleBlue1(float newValue) {
|
||||
particleBlue1 = newValue;
|
||||
};
|
||||
void SetParticleBlue2(float newValue) {
|
||||
particleBlue2 = newValue;
|
||||
};
|
||||
void SetParticleAlpha1(float newValue) {
|
||||
particleAlpha1 = newValue;
|
||||
};
|
||||
void SetParticleAlpha2(float newValue) {
|
||||
particleAlpha2 = newValue;
|
||||
};
|
||||
void SetParticleSize1(float newValue) {
|
||||
particleSize1 = newValue;
|
||||
};
|
||||
void SetParticleSize2(float newValue) {
|
||||
particleSize2 = newValue;
|
||||
};
|
||||
void SetParticleAngle1(float newValue) {
|
||||
particleAngle1 = newValue;
|
||||
};
|
||||
void SetParticleAngle2(float newValue) {
|
||||
particleAngle2 = newValue;
|
||||
};
|
||||
void SetParticleAlphaRandomness1(float newValue) {
|
||||
particleAlphaRandomness1 = newValue;
|
||||
};
|
||||
void SetParticleAlphaRandomness2(double newValue) {
|
||||
void SetParticleAlphaRandomness2(float newValue) {
|
||||
particleAlphaRandomness2 = newValue;
|
||||
};
|
||||
void SetParticleSizeRandomness1(double newValue) {
|
||||
void SetParticleSizeRandomness1(float newValue) {
|
||||
particleSizeRandomness1 = newValue;
|
||||
};
|
||||
void SetParticleSizeRandomness2(double newValue) {
|
||||
void SetParticleSizeRandomness2(float newValue) {
|
||||
particleSizeRandomness2 = newValue;
|
||||
};
|
||||
void SetParticleAngleRandomness1(double newValue) {
|
||||
void SetParticleAngleRandomness1(float newValue) {
|
||||
particleAngleRandomness1 = newValue;
|
||||
};
|
||||
void SetParticleAngleRandomness2(double newValue) {
|
||||
void SetParticleAngleRandomness2(float newValue) {
|
||||
particleAngleRandomness2 = newValue;
|
||||
};
|
||||
void SetParticleLifeTimeMin(double newValue) {
|
||||
void SetParticleLifeTimeMin(float newValue) {
|
||||
particleLifeTimeMin = newValue;
|
||||
};
|
||||
void SetParticleLifeTimeMax(double newValue) {
|
||||
void SetParticleLifeTimeMax(float newValue) {
|
||||
particleLifeTimeMax = newValue;
|
||||
};
|
||||
void SetMaxParticleNb(std::size_t newValue) { maxParticleNb = newValue; };
|
||||
@@ -92,49 +118,50 @@ class GD_EXTENSION_API ParticleEmitterBase {
|
||||
destroyWhenNoParticles = enable;
|
||||
};
|
||||
|
||||
double GetRendererParam1() const { return rendererParam1; };
|
||||
double GetRendererParam2() const { return rendererParam2; };
|
||||
double GetTank() const { return tank; };
|
||||
double GetFlow() const { return flow; };
|
||||
double GetEmitterForceMin() const { return emitterForceMin; };
|
||||
double GetEmitterForceMax() const { return emitterForceMax; };
|
||||
double GetEmitterAngleA() const { return emitterAngleA; };
|
||||
double GetEmitterAngleB() const { return emitterAngleB; };
|
||||
double GetConeSprayAngle() const { return GetEmitterAngleB(); };
|
||||
double GetZoneRadius() const { return zoneRadius; };
|
||||
double GetParticleGravityX() const { return particleGravityX; };
|
||||
double GetParticleGravityY() const { return particleGravityY; };
|
||||
double GetParticleGravityAngle() const;
|
||||
double GetParticleGravityLength() const;
|
||||
double GetParticleLifeTimeMin() const { return particleLifeTimeMin; };
|
||||
double GetParticleLifeTimeMax() const { return particleLifeTimeMax; };
|
||||
float GetRendererParam1() const { return rendererParam1; };
|
||||
float GetRendererParam2() const { return rendererParam2; };
|
||||
float GetTank() const { return tank; };
|
||||
float GetFlow() const { return flow; };
|
||||
float GetEmitterForceMin() const { return emitterForceMin; };
|
||||
float GetEmitterForceMax() const { return emitterForceMax; };
|
||||
float GetEmitterAngleA() const { return emitterAngleA; };
|
||||
float GetEmitterAngleB() const { return emitterAngleB; };
|
||||
float GetConeSprayAngle() const { return GetEmitterAngleB(); };
|
||||
float GetZoneRadius() const { return zoneRadius; };
|
||||
float GetParticleGravityX() const { return particleGravityX; };
|
||||
float GetParticleGravityY() const { return particleGravityY; };
|
||||
float GetParticleGravityAngle() const;
|
||||
float GetParticleGravityLength() const;
|
||||
float GetParticleLifeTimeMin() const { return particleLifeTimeMin; };
|
||||
float GetParticleLifeTimeMax() const { return particleLifeTimeMax; };
|
||||
std::size_t GetMaxParticleNb() const { return maxParticleNb; };
|
||||
bool GetDestroyWhenNoParticles() const { return destroyWhenNoParticles; };
|
||||
|
||||
double GetParticleRed1() const { return particleRed1; };
|
||||
double GetParticleRed2() const { return particleRed2; };
|
||||
double GetParticleGreen1() const { return particleGreen1; };
|
||||
double GetParticleGreen2() const { return particleGreen2; };
|
||||
double GetParticleBlue1() const { return particleBlue1; };
|
||||
double GetParticleBlue2() const { return particleBlue2; };
|
||||
double GetParticleAlpha1() const { return particleAlpha1; };
|
||||
double GetParticleAlpha2() const { return particleAlpha2; };
|
||||
double GetParticleSize1() const { return particleSize1; };
|
||||
double GetParticleSize2() const { return particleSize2; };
|
||||
double GetParticleAngle1() const { return particleAngle1; };
|
||||
double GetParticleAngle2() const { return particleAngle2; };
|
||||
double GetParticleAlphaRandomness1() const {
|
||||
|
||||
float GetParticleRed1() const { return particleRed1; };
|
||||
float GetParticleRed2() const { return particleRed2; };
|
||||
float GetParticleGreen1() const { return particleGreen1; };
|
||||
float GetParticleGreen2() const { return particleGreen2; };
|
||||
float GetParticleBlue1() const { return particleBlue1; };
|
||||
float GetParticleBlue2() const { return particleBlue2; };
|
||||
float GetParticleAlpha1() const { return particleAlpha1; };
|
||||
float GetParticleAlpha2() const { return particleAlpha2; };
|
||||
float GetParticleSize1() const { return particleSize1; };
|
||||
float GetParticleSize2() const { return particleSize2; };
|
||||
float GetParticleAngle1() const { return particleAngle1; };
|
||||
float GetParticleAngle2() const { return particleAngle2; };
|
||||
float GetParticleAlphaRandomness1() const {
|
||||
return particleAlphaRandomness1;
|
||||
};
|
||||
double GetParticleAlphaRandomness2() const {
|
||||
float GetParticleAlphaRandomness2() const {
|
||||
return particleAlphaRandomness2;
|
||||
};
|
||||
double GetParticleSizeRandomness1() const { return particleSizeRandomness1; };
|
||||
double GetParticleSizeRandomness2() const { return particleSizeRandomness2; };
|
||||
double GetParticleAngleRandomness1() const {
|
||||
float GetParticleSizeRandomness1() const { return particleSizeRandomness1; };
|
||||
float GetParticleSizeRandomness2() const { return particleSizeRandomness2; };
|
||||
float GetParticleAngleRandomness1() const {
|
||||
return particleAngleRandomness1;
|
||||
};
|
||||
double GetParticleAngleRandomness2() const {
|
||||
float GetParticleAngleRandomness2() const {
|
||||
return particleAngleRandomness2;
|
||||
};
|
||||
|
||||
@@ -157,23 +184,23 @@ class GD_EXTENSION_API ParticleEmitterBase {
|
||||
|
||||
gd::String textureParticleName;
|
||||
RendererType rendererType;
|
||||
double rendererParam1;
|
||||
double rendererParam2;
|
||||
float rendererParam1;
|
||||
float rendererParam2;
|
||||
bool additive;
|
||||
double tank;
|
||||
double flow;
|
||||
double emitterForceMin;
|
||||
double emitterForceMax;
|
||||
double emitterAngleA;
|
||||
double emitterAngleB;
|
||||
double zoneRadius;
|
||||
double particleGravityX, particleGravityY;
|
||||
double particleLifeTimeMin, particleLifeTimeMax;
|
||||
double particleRed1, particleRed2, particleGreen1, particleGreen2,
|
||||
float tank;
|
||||
float flow;
|
||||
float emitterForceMin;
|
||||
float emitterForceMax;
|
||||
float emitterAngleA;
|
||||
float emitterAngleB;
|
||||
float zoneRadius;
|
||||
float particleGravityX, particleGravityY;
|
||||
float particleLifeTimeMin, particleLifeTimeMax;
|
||||
float particleRed1, particleRed2, particleGreen1, particleGreen2,
|
||||
particleBlue1, particleBlue2, particleAlpha1, particleAlpha2;
|
||||
double particleSize1, particleSize2, particleAngle1, particleAngle2;
|
||||
double particleAlphaRandomness1, particleAlphaRandomness2;
|
||||
double particleSizeRandomness1, particleSizeRandomness2,
|
||||
float particleSize1, particleSize2, particleAngle1, particleAngle2;
|
||||
float particleAlphaRandomness1, particleAlphaRandomness2;
|
||||
float particleSizeRandomness1, particleSizeRandomness2,
|
||||
particleAngleRandomness1, particleAngleRandomness2;
|
||||
std::size_t maxParticleNb;
|
||||
bool destroyWhenNoParticles; ///< If set to true, the object will removed
|
||||
|
@@ -5,10 +5,10 @@ Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
|
||||
#include "GDCore/Extensions/PlatformExtension.h"
|
||||
#include "GDCore/Project/BehaviorsSharedData.h"
|
||||
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCore/Project/BehaviorsSharedData.h"
|
||||
#include "PathfindingBehavior.h"
|
||||
#include "PathfindingObstacleBehavior.h"
|
||||
|
||||
@@ -89,8 +89,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetCellWidth")
|
||||
.SetGetter("GetCellWidth");
|
||||
|
||||
@@ -104,8 +103,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetCellWidth");
|
||||
|
||||
aut.AddAction("CellHeight",
|
||||
@@ -118,8 +116,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetCellHeight")
|
||||
.SetGetter("GetCellHeight");
|
||||
|
||||
@@ -133,8 +130,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetCellHeight");
|
||||
|
||||
aut.AddAction("Acceleration",
|
||||
@@ -147,8 +143,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetAcceleration")
|
||||
.SetGetter("GetAcceleration");
|
||||
|
||||
@@ -162,8 +157,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetAcceleration");
|
||||
|
||||
aut.AddAction("MaxSpeed",
|
||||
@@ -176,10 +170,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetMaxSpeed")
|
||||
.SetGetter("GetMaxSpeed");
|
||||
|
||||
@@ -193,10 +184,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetMaxSpeed");
|
||||
|
||||
aut.AddAction("Speed",
|
||||
@@ -209,10 +197,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetSpeed")
|
||||
.SetGetter("GetSpeed");
|
||||
|
||||
@@ -226,21 +211,17 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetSpeed");
|
||||
|
||||
aut.AddScopedCondition(
|
||||
"MovementAngleIsAround",
|
||||
_("Angle of movement on its path"),
|
||||
_("Compare the angle of movement of an object on its path."),
|
||||
_("Angle of movement of _PARAM0_ is _PARAM2_ (tolerance"
|
||||
": _PARAM3_ degrees)"),
|
||||
_("Movement on the path"),
|
||||
"CppPlatform/Extensions/AStaricon24.png",
|
||||
"CppPlatform/Extensions/AStaricon16.png")
|
||||
aut.AddScopedCondition("MovementAngleIsAround",
|
||||
_("Angle of movement on its path"),
|
||||
_("Compare the angle of movement of an object on its path."),
|
||||
_("Angle of movement of _PARAM0_ is _PARAM2_ (tolerance"
|
||||
": _PARAM3_ degrees)"),
|
||||
_("Movement on the path"),
|
||||
"CppPlatform/Extensions/AStaricon24.png",
|
||||
"CppPlatform/Extensions/AStaricon16.png")
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
@@ -257,10 +238,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max angular speed (in degrees per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetAngularMaxSpeed")
|
||||
.SetGetter("GetAngularMaxSpeed");
|
||||
|
||||
@@ -275,10 +253,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max angular speed to compare to (in degrees per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetAngularMaxSpeed");
|
||||
|
||||
aut.AddAction(
|
||||
@@ -292,10 +267,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetAngleOffset")
|
||||
.SetGetter("GetAngleOffset");
|
||||
|
||||
@@ -309,10 +281,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetAngleOffset");
|
||||
|
||||
aut.AddAction(
|
||||
@@ -327,8 +296,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetExtraBorder")
|
||||
.SetGetter("GetExtraBorder");
|
||||
|
||||
@@ -343,8 +311,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetExtraBorder");
|
||||
|
||||
aut.AddAction(
|
||||
@@ -581,7 +548,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/AStaricon24.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardParameters("number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
aut.AddExpressionAndConditionAndAction("number",
|
||||
"GridOffsetY",
|
||||
@@ -592,7 +559,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/AStaricon24.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingBehavior")
|
||||
.UseStandardParameters("number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
}
|
||||
{
|
||||
@@ -617,8 +584,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingObstacleBehavior")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetCost")
|
||||
.SetGetter("GetCost");
|
||||
|
||||
@@ -632,8 +598,7 @@ void DeclarePathfindingBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PathfindingObstacleBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetCost");
|
||||
|
||||
aut.AddAction("SetImpassable",
|
||||
|
@@ -8,7 +8,6 @@ This project is released under the MIT License.
|
||||
#ifndef PATHFINDINGOBSTACLEBEHAVIOR_H
|
||||
#define PATHFINDINGOBSTACLEBEHAVIOR_H
|
||||
#include <map>
|
||||
|
||||
#include "GDCore/Project/Behavior.h"
|
||||
namespace gd {
|
||||
class SerializerElement;
|
||||
@@ -29,11 +28,13 @@ class GD_EXTENSION_API PathfindingObstacleBehavior : public gd::Behavior {
|
||||
return new PathfindingObstacleBehavior(*this);
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
virtual std::map<gd::String, gd::PropertyDescriptor> GetProperties(
|
||||
const gd::SerializerElement& behaviorContent) const override;
|
||||
virtual bool UpdateProperty(gd::SerializerElement& behaviorContent,
|
||||
const gd::String& name,
|
||||
const gd::String& value) override;
|
||||
#endif
|
||||
|
||||
virtual void InitializeContent(
|
||||
gd::SerializerElement& behaviorContent) override;
|
||||
|
@@ -441,12 +441,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Gravity to compare to (in pixels per second per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getGravityX');
|
||||
|
||||
@@ -475,12 +470,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Gravity to compare to (in pixels per second per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getGravityY');
|
||||
|
||||
@@ -530,12 +520,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Time scale to compare to (1 by default)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getTimeScale');
|
||||
|
||||
@@ -556,7 +541,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('objectList', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Time scale (1 by default)'))
|
||||
.addParameter('expression', _('Value'))
|
||||
.getCodeExtraInformation()
|
||||
.setIncludeFile('Extensions/Physics2Behavior/physics2tools.js')
|
||||
.setFunctionName('gdjs.physics2.setTimeScale');
|
||||
@@ -803,12 +788,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Scale (1 by default)')
|
||||
)
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setShapeScale')
|
||||
.setGetter('getShapeScale');
|
||||
@@ -825,10 +805,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getDensity');
|
||||
|
||||
@@ -846,10 +823,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setDensity')
|
||||
.setGetter('getDensity');
|
||||
@@ -879,10 +853,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getFriction');
|
||||
|
||||
@@ -900,10 +871,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setFriction')
|
||||
.setGetter('getFriction');
|
||||
@@ -933,10 +901,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getRestitution');
|
||||
|
||||
@@ -954,10 +919,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setRestitution')
|
||||
.setGetter('getRestitution');
|
||||
@@ -987,10 +949,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getLinearDamping');
|
||||
|
||||
@@ -1008,10 +967,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setLinearDamping')
|
||||
.setGetter('getLinearDamping');
|
||||
@@ -1041,10 +997,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getAngularDamping');
|
||||
|
||||
@@ -1062,10 +1015,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setAngularDamping')
|
||||
.setGetter('getAngularDamping');
|
||||
@@ -1095,12 +1045,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Scale to compare to (1 by default)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getGravityScale');
|
||||
|
||||
@@ -1118,12 +1063,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Scale (1 by default)')
|
||||
)
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setGravityScale')
|
||||
.setGetter('getGravityScale');
|
||||
@@ -1227,12 +1167,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Speed to compare to (in pixels per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getLinearVelocityX');
|
||||
|
||||
@@ -1248,12 +1183,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Speed (in pixels per second)')
|
||||
)
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setLinearVelocityX')
|
||||
.setGetter('getLinearVelocityX');
|
||||
@@ -1283,12 +1213,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Speed to compare to (in pixels per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getLinearVelocityY');
|
||||
|
||||
@@ -1304,12 +1229,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Speed (in pixels per second)')
|
||||
)
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setLinearVelocityY')
|
||||
.setGetter('getLinearVelocityY');
|
||||
@@ -1339,12 +1259,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Speed to compare to (in pixels per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getLinearVelocityLength');
|
||||
|
||||
@@ -1373,12 +1288,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Angular speed to compare to (in degrees per second)')
|
||||
)
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getAngularVelocity');
|
||||
|
||||
@@ -1394,12 +1304,7 @@ module.exports = {
|
||||
)
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Angular speed (in degrees per second)')
|
||||
)
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setAngularVelocity')
|
||||
.setGetter('getAngularVelocity');
|
||||
@@ -1588,7 +1493,7 @@ module.exports = {
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('applyAngularImpulse');
|
||||
|
||||
aut
|
||||
aut
|
||||
.addExpression(
|
||||
'Mass',
|
||||
_('Mass'),
|
||||
@@ -1742,10 +1647,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getJointReactionForce');
|
||||
|
||||
@@ -1776,10 +1678,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardRelationalOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardRelationalOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('getJointReactionTorque');
|
||||
|
||||
@@ -1883,10 +1782,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setDistanceJointLength')
|
||||
.setGetter('getDistanceJointLength');
|
||||
@@ -1918,10 +1814,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setDistanceJointFrequency')
|
||||
.setGetter('getDistanceJointFrequency');
|
||||
@@ -1953,10 +1846,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setDistanceJointDampingRatio')
|
||||
.setGetter('getDistanceJointDampingRatio');
|
||||
@@ -2251,10 +2141,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setRevoluteJointMotorSpeed')
|
||||
.setGetter('getRevoluteJointMotorSpeed');
|
||||
@@ -2286,10 +2173,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setRevoluteJointMaxMotorTorque')
|
||||
.setGetter('getRevoluteJointMaxMotorTorque');
|
||||
@@ -2569,10 +2453,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setPrismaticJointMotorSpeed')
|
||||
.setGetter('getPrismaticJointMotorSpeed');
|
||||
@@ -2604,10 +2485,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setPrismaticJointMaxMotorForce')
|
||||
.setGetter('getPrismaticJointMaxMotorForce');
|
||||
@@ -2877,10 +2755,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setGearJointRatio')
|
||||
.setGetter('getGearJointRatio');
|
||||
@@ -3007,10 +2882,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMouseJointMaxForce')
|
||||
.setGetter('getMouseJointMaxForce');
|
||||
@@ -3042,10 +2914,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMouseJointFrequency')
|
||||
.setGetter('getMouseJointFrequency');
|
||||
@@ -3077,10 +2946,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMouseJointDampingRatio')
|
||||
.setGetter('getMouseJointDampingRatio');
|
||||
@@ -3249,10 +3115,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWheelJointMotorSpeed')
|
||||
.setGetter('getWheelJointMotorSpeed');
|
||||
@@ -3284,10 +3147,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWheelJointMaxMotorTorque')
|
||||
.setGetter('getWheelJointMaxMotorTorque');
|
||||
@@ -3333,10 +3193,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWheelJointFrequency')
|
||||
.setGetter('getWheelJointFrequency');
|
||||
@@ -3368,10 +3225,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWheelJointDampingRatio')
|
||||
.setGetter('getWheelJointDampingRatio');
|
||||
@@ -3467,10 +3321,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWeldJointFrequency')
|
||||
.setGetter('getWeldJointFrequency');
|
||||
@@ -3502,10 +3353,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setWeldJointDampingRatio')
|
||||
.setGetter('getWeldJointDampingRatio');
|
||||
@@ -3580,10 +3428,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setRopeJointMaxLength')
|
||||
.setGetter('getRopeJointMaxLength');
|
||||
@@ -3651,10 +3496,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setFrictionJointMaxForce')
|
||||
.setGetter('getFrictionJointMaxForce');
|
||||
@@ -3686,10 +3528,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setFrictionJointMaxTorque')
|
||||
.setGetter('getFrictionJointMaxTorque');
|
||||
@@ -3806,10 +3645,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMotorJointAngularOffset')
|
||||
.setGetter('getMotorJointAngularOffset');
|
||||
@@ -3841,10 +3677,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMotorJointMaxForce')
|
||||
.setGetter('getMotorJointMaxForce');
|
||||
@@ -3876,10 +3709,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMotorJointMaxTorque')
|
||||
.setGetter('getMotorJointMaxTorque');
|
||||
@@ -3911,10 +3741,7 @@ module.exports = {
|
||||
.addParameter('object', _('Object'), '', false)
|
||||
.addParameter('behavior', _('Behavior'), 'Physics2Behavior')
|
||||
.addParameter('expression', _('Joint ID'))
|
||||
.useStandardOperatorParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions()
|
||||
)
|
||||
.useStandardOperatorParameters('number')
|
||||
.getCodeExtraInformation()
|
||||
.setFunctionName('setMotorJointCorrectionFactor')
|
||||
.setGetter('getMotorJointCorrectionFactor');
|
||||
@@ -3940,7 +3767,7 @@ module.exports = {
|
||||
_('Collision'),
|
||||
_('Check if two objects collide.'),
|
||||
_('_PARAM0_ is colliding with _PARAM2_'),
|
||||
'',
|
||||
'',
|
||||
'res/physics32.png',
|
||||
'res/physics32.png'
|
||||
)
|
||||
|
@@ -337,8 +337,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetLinearVelocityX");
|
||||
|
||||
@@ -352,8 +351,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetLinearVelocityY");
|
||||
|
||||
@@ -366,8 +364,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetLinearVelocity");
|
||||
|
||||
@@ -393,8 +390,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetAngularVelocity");
|
||||
|
||||
@@ -407,8 +403,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetLinearDamping");
|
||||
|
||||
@@ -450,8 +445,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetAngularDamping");
|
||||
|
||||
@@ -522,8 +516,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetPolygonScaleX");
|
||||
|
||||
@@ -537,8 +530,7 @@ void DeclarePhysicsBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"res/physics16.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PhysicsBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.AddCodeOnlyParameter("currentScene", "")
|
||||
.SetFunctionName("GetPolygonScaleY");
|
||||
|
||||
|
@@ -5,10 +5,11 @@ Copyright (c) 2014-2016 Florian Rival (Florian.Rival@gmail.com)
|
||||
This project is released under the MIT License.
|
||||
*/
|
||||
|
||||
#include "GDCore/Extensions/PlatformExtension.h"
|
||||
#include "GDCore/Project/BehaviorsSharedData.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "PlatformBehavior.h"
|
||||
|
||||
#include "GDCore/Extensions/PlatformExtension.h"
|
||||
#include "GDCore/Tools/Localization.h"
|
||||
#include "GDCore/Project/BehaviorsSharedData.h"
|
||||
#include "PlatformerObjectBehavior.h"
|
||||
|
||||
void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
@@ -133,71 +134,61 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
|
||||
aut.AddCondition("Gravity",
|
||||
_("Gravity"),
|
||||
_("Compare the gravity applied on the object."),
|
||||
_("Compare the gravity applied on the object (in pixels "
|
||||
"per second per second)."),
|
||||
_("the gravity"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Gravity to compare to (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetGravity");
|
||||
|
||||
aut.AddAction("Gravity",
|
||||
_("Gravity"),
|
||||
_("Change the gravity applied on an object."),
|
||||
_("Change the gravity applied on an object (in pixels per "
|
||||
"second per second)."),
|
||||
_("the gravity"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Gravity (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetGravity")
|
||||
.SetGetter("GetGravity");
|
||||
|
||||
aut.AddCondition("MaxFallingSpeed",
|
||||
_("Maximum falling speed"),
|
||||
_("Compare the maximum falling speed of the object."),
|
||||
_("the maximum falling speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddCondition(
|
||||
"MaxFallingSpeed",
|
||||
_("Maximum falling speed"),
|
||||
_("Compare the maximum falling speed of the object (in pixels per "
|
||||
"second)."),
|
||||
_("the maximum falling speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetMaxFallingSpeed");
|
||||
|
||||
aut.AddAction("MaxFallingSpeed",
|
||||
_("Maximum falling speed"),
|
||||
_("Change the maximum falling speed of an object."),
|
||||
_("the maximum falling speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddAction(
|
||||
"MaxFallingSpeed",
|
||||
_("Maximum falling speed"),
|
||||
_("Change the maximum falling speed of an object (in pixels per "
|
||||
"second)."),
|
||||
_("the maximum falling speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed (in pixels per second)")))
|
||||
.AddParameter(
|
||||
"yesorno",
|
||||
_("If jumping, try to preserve the current speed in the air"))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.AddParameter("yesorno", _("If jumping, try to preserve the current speed in the air"))
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetMaxFallingSpeed")
|
||||
.SetGetter("GetMaxFallingSpeed");
|
||||
@@ -212,170 +203,145 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetLadderClimbingSpeed");
|
||||
|
||||
aut.AddAction("LadderClimbingSpeed",
|
||||
_("Ladder climbing speed"),
|
||||
_("Change the ladder climbing speed."),
|
||||
_("Change the ladder climbing speed (in pixels per "
|
||||
"second)."),
|
||||
_("the ladder climbing speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetLadderClimbingSpeed")
|
||||
.SetGetter("GetLadderClimbingSpeed");
|
||||
|
||||
aut.AddCondition("Acceleration",
|
||||
_("Acceleration"),
|
||||
_("Compare the horizontal acceleration of the object."),
|
||||
_("Compare the horizontal acceleration of the object (in pixels per "
|
||||
"second per second)."),
|
||||
_("the horizontal acceleration"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Acceleration to compare to (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetAcceleration");
|
||||
|
||||
aut.AddAction("Acceleration",
|
||||
_("Acceleration"),
|
||||
_("Change the horizontal acceleration of an object."),
|
||||
_("Change the horizontal acceleration of an object (in pixels per "
|
||||
"second per second)."),
|
||||
_("the horizontal acceleration"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Acceleration (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetAcceleration")
|
||||
.SetGetter("GetAcceleration");
|
||||
|
||||
aut.AddCondition("Deceleration",
|
||||
_("Deceleration"),
|
||||
_("Compare the horizontal deceleration of the object."),
|
||||
_("Compare the horizontal deceleration of the object (in pixels per "
|
||||
"second per second)."),
|
||||
_("the horizontal deceleration"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Deceleration to compare to (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetDeceleration");
|
||||
|
||||
aut.AddAction("Deceleration",
|
||||
_("Deceleration"),
|
||||
_("Change the horizontal deceleration of an object."),
|
||||
_("Change the horizontal deceleration of an object (in pixels per "
|
||||
"second per second)."),
|
||||
_("the horizontal deceleration"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Deceleration (in pixels per "
|
||||
"second per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetDeceleration")
|
||||
.SetGetter("GetDeceleration");
|
||||
|
||||
aut.AddCondition("MaxSpeed",
|
||||
_("Maximum horizontal speed"),
|
||||
_("Compare the maximum horizontal speed of the object."),
|
||||
_("the maximum horizontal speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddCondition(
|
||||
"MaxSpeed",
|
||||
_("Maximum horizontal speed"),
|
||||
_("Compare the maximum horizontal speed of the object (in pixels per second)."),
|
||||
_("the maximum horizontal speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetMaxSpeed");
|
||||
|
||||
aut.AddAction("MaxSpeed",
|
||||
_("Maximum horizontal speed"),
|
||||
_("Change the maximum horizontal speed of an object."),
|
||||
_("the maximum horizontal speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddAction(
|
||||
"MaxSpeed",
|
||||
_("Maximum horizontal speed"),
|
||||
_("Change the maximum horizontal speed of an object (in pixels per second)."),
|
||||
_("the maximum horizontal speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Max speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("SetMaxSpeed")
|
||||
.SetGetter("GetMaxSpeed");
|
||||
|
||||
aut.AddCondition("JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Compare the jump speed of the object."
|
||||
"Its value is always positive."),
|
||||
_("the jump speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddCondition(
|
||||
"JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Compare the jump speed of the object (in pixels per second)."
|
||||
"Its value is always positive."),
|
||||
_("the jump speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetJumpSpeed");
|
||||
|
||||
aut.AddAction("JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Change the jump speed of an object. "
|
||||
"Its value is always positive."),
|
||||
_("the jump speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddAction(
|
||||
"JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Change the jump speed of an object (in pixels per second). "
|
||||
"Its value is always positive."),
|
||||
_("the jump speed"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetJumpSpeed")
|
||||
.SetGetter("GetJumpSpeed");
|
||||
|
||||
aut.AddCondition(
|
||||
"JumpSustainTime",
|
||||
_("Jump sustain time"),
|
||||
_("Compare the jump sustain time of the object."
|
||||
_("Compare the jump sustain time of the object (in seconds)."
|
||||
"This is the time during which keeping the jump button held "
|
||||
"allow the initial jump speed to be maintained."),
|
||||
_("the jump sustain time"),
|
||||
@@ -384,28 +350,21 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration to compare to (in seconds)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
aut.AddAction(
|
||||
"JumpSustainTime",
|
||||
_("Jump sustain time"),
|
||||
_("Change the jump sustain time of an object."
|
||||
"This is the time during which keeping the jump button held "
|
||||
"allow the initial jump speed to be maintained."),
|
||||
_("the jump sustain time"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddAction("JumpSustainTime",
|
||||
_("Jump sustain time"),
|
||||
_("Change the jump sustain time of an object (in seconds). "
|
||||
"This is the time during which keeping the jump button held "
|
||||
"allow the initial jump speed to be maintained."),
|
||||
_("the jump sustain time"),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Duration (in seconds)")));
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
aut.AddAction(
|
||||
"SetCanJump",
|
||||
@@ -441,8 +400,7 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"AbortJump",
|
||||
_("Abort jump"),
|
||||
_("Abort the current jump and stop the object vertically. "
|
||||
"This action doesn't have any effect when the character is not "
|
||||
"jumping."),
|
||||
"This action doesn't have any effect when the character is not jumping."),
|
||||
_("Abort the current jump of _PARAM0_"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
@@ -631,28 +589,11 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
.MarkAsSimple()
|
||||
.SetFunctionName("canGrabPlatforms");
|
||||
|
||||
aut.AddCondition("CurrentFallSpeed",
|
||||
_("Current falling speed"),
|
||||
_("Compare the current falling speed of the object. Its "
|
||||
"value is always positive."),
|
||||
_("the current falling speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetCurrentFallSpeed");
|
||||
|
||||
aut.AddScopedAction(
|
||||
"SetCurrentFallSpeed",
|
||||
_("Current falling speed"),
|
||||
_("Change the current falling speed of the object. This action "
|
||||
"doesn't have any effect when the character "
|
||||
_("Change the current falling speed of the object (in pixels per "
|
||||
"second). This action doesn't have any effect when the character "
|
||||
"is not falling or is in the first phase of a jump."),
|
||||
_("the current falling speed"),
|
||||
_(""),
|
||||
@@ -660,70 +601,72 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
aut.AddCondition("CurrentJumpSpeed",
|
||||
_("Current jump speed"),
|
||||
_("Compare the current jump speed of the object. Its "
|
||||
"value is always positive."),
|
||||
_("the current jump speed"),
|
||||
aut.AddCondition(
|
||||
"CurrentFallSpeed",
|
||||
_("Current falling speed"),
|
||||
_("Compare the current falling speed of the object (in pixels per "
|
||||
"second). Its value is always positive."),
|
||||
_("the current falling speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetCurrentFallSpeed");
|
||||
|
||||
aut.AddCondition(
|
||||
"CurrentJumpSpeed",
|
||||
_("Current jump speed"),
|
||||
_("Compare the current jump speed of the object (in pixels per "
|
||||
"second). Its value is always positive."),
|
||||
_("the current jump speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetCurrentJumpSpeed");
|
||||
|
||||
aut.AddScopedAction("SetCurrentSpeed",
|
||||
_("Current horizontal speed"),
|
||||
_("Change the current horizontal speed of the object "
|
||||
"(in pixels per second). The object moves to the left "
|
||||
"with negative values and to the right with positive ones"),
|
||||
_("the current horizontal speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetCurrentJumpSpeed");
|
||||
|
||||
aut.AddScopedAction(
|
||||
"SetCurrentSpeed",
|
||||
_("Current horizontal speed"),
|
||||
_("Change the current horizontal speed of the object. The object "
|
||||
"moves to the left with negative values and to the right with "
|
||||
"positive ones"),
|
||||
_("the current horizontal speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed (in pixels per second)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
aut.AddCondition(
|
||||
"CurrentSpeed",
|
||||
_("Current horizontal speed"),
|
||||
_("Compare the current horizontal speed of the object. The object "
|
||||
"moves to the left "
|
||||
"with negative values and to the right with positive ones"),
|
||||
_("the current horizontal speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddCondition("CurrentSpeed",
|
||||
_("Current horizontal speed"),
|
||||
_("Compare the current horizontal speed of the object "
|
||||
"(in pixels per second). The object moves to the left "
|
||||
"with negative values and to the right with positive ones"),
|
||||
_("the current horizontal speed"),
|
||||
_(""),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png",
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Speed to compare to (in pixels per second)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.MarkAsAdvanced()
|
||||
.SetFunctionName("GetCurrentSpeed");
|
||||
|
||||
aut.AddExpression("Gravity",
|
||||
_("Gravity"),
|
||||
_("Return the gravity applied on the object "
|
||||
"(in pixels per second per second)."),
|
||||
"(in pixels per second per second)."),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
@@ -753,7 +696,7 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
aut.AddExpression("Acceleration",
|
||||
_("Acceleration"),
|
||||
_("Return the horizontal acceleration of the object "
|
||||
"(in pixels per second per second)."),
|
||||
"(in pixels per second per second)."),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
@@ -763,7 +706,7 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
aut.AddExpression("Deceleration",
|
||||
_("Deceleration"),
|
||||
_("Return the horizontal deceleration of the object "
|
||||
"(in pixels per second per second)."),
|
||||
"(in pixels per second per second)."),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
@@ -780,13 +723,12 @@ void DeclarePlatformBehaviorExtension(gd::PlatformExtension& extension) {
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.SetFunctionName("GetMaxSpeed");
|
||||
|
||||
aut.AddExpression(
|
||||
"JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Return the jump speed of the object "
|
||||
"(in pixels per second). Its value is always positive."),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
aut.AddExpression("JumpSpeed",
|
||||
_("Jump speed"),
|
||||
_("Return the jump speed of the object "
|
||||
"(in pixels per second). Its value is always positive."),
|
||||
_("Options"),
|
||||
"CppPlatform/Extensions/platformerobjecticon.png")
|
||||
.AddParameter("object", _("Object"))
|
||||
.AddParameter("behavior", _("Behavior"), "PlatformerObjectBehavior")
|
||||
.SetFunctionName("GetJumpSpeed");
|
||||
|
@@ -28,7 +28,7 @@ module.exports = {
|
||||
extension
|
||||
.setExtensionInformation(
|
||||
'PlayerAuthentication',
|
||||
_('Player Authentication'),
|
||||
_('Player Authentication (experimental)'),
|
||||
_('Allow your game to authenticate players.'),
|
||||
'Florian Rival',
|
||||
'Open source (MIT License)'
|
||||
@@ -36,7 +36,9 @@ module.exports = {
|
||||
.setExtensionHelpPath('/all-features/player-authentication')
|
||||
.setCategory('Players');
|
||||
extension
|
||||
.addInstructionOrExpressionGroupMetadata(_('Player Authentication'))
|
||||
.addInstructionOrExpressionGroupMetadata(
|
||||
_('Player Authentication (experimental)')
|
||||
)
|
||||
.setIcon('JsPlatform/Extensions/authentication.svg');
|
||||
|
||||
extension
|
||||
|
@@ -19,11 +19,10 @@ namespace gdjs {
|
||||
'If the window did not open, please check your pop-up blocker and click the button below to try again.',
|
||||
}
|
||||
: {
|
||||
title: 'Publish your game!',
|
||||
title: 'Your game is not registered!',
|
||||
text1:
|
||||
"GDevelop's player accounts are only available for published games.",
|
||||
text2:
|
||||
'Click the button below to learn how to publish your game then try again.',
|
||||
'In order to use player authentication, this game must be registered with GDevelop Services first.',
|
||||
text2: 'Head to your Game Dashboard, then try again.',
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -120,8 +119,7 @@ namespace gdjs {
|
||||
export const addAuthenticationTextsToLoadingContainer = (
|
||||
loaderContainer: HTMLDivElement,
|
||||
platform,
|
||||
isGameRegistered,
|
||||
wikiOpenAction
|
||||
isGameRegistered
|
||||
) => {
|
||||
const textContainer: HTMLDivElement = document.createElement('div');
|
||||
textContainer.id = 'authentication-container-texts';
|
||||
@@ -153,20 +151,8 @@ namespace gdjs {
|
||||
textContainer.appendChild(text2);
|
||||
|
||||
if (!isGameRegistered) {
|
||||
// Remove the loader and add the wiki link.
|
||||
// Remove the loader.
|
||||
loaderContainer.innerHTML = '';
|
||||
|
||||
if (wikiOpenAction) {
|
||||
const link = document.createElement('a');
|
||||
addTouchAndClickEventListeners(link, wikiOpenAction);
|
||||
link.innerText = 'How to publish my game';
|
||||
link.style.color = '#0078d4';
|
||||
link.style.textDecoration = 'none';
|
||||
link.style.textDecoration = 'underline';
|
||||
link.style.cursor = 'pointer';
|
||||
|
||||
textContainer.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
loaderContainer.prepend(textContainer);
|
||||
@@ -184,7 +170,7 @@ namespace gdjs {
|
||||
) => {
|
||||
const link = document.createElement('a');
|
||||
addTouchAndClickEventListeners(link, onClick);
|
||||
link.innerText = 'Try again';
|
||||
link.innerText = 'Click here to authenticate';
|
||||
link.style.color = '#0078d4';
|
||||
link.style.textDecoration = 'none';
|
||||
link.style.textDecoration = 'underline';
|
||||
|
@@ -622,19 +622,10 @@ namespace gdjs {
|
||||
checkIfGameIsRegistered(runtimeScene.getGame(), _gameId)
|
||||
.then((isGameRegistered) => {
|
||||
if (_authenticationLoaderContainer) {
|
||||
const electron = runtimeScene.getGame().getRenderer().getElectron();
|
||||
const wikiOpenAction = electron
|
||||
? () =>
|
||||
electron.shell.openExternal(
|
||||
'https://wiki.gdevelop.io/gdevelop5/publishing/web'
|
||||
)
|
||||
: null; // Only show a link if we're on electron.
|
||||
|
||||
_authenticationTextContainer = authComponents.addAuthenticationTextsToLoadingContainer(
|
||||
_authenticationLoaderContainer,
|
||||
platform,
|
||||
isGameRegistered,
|
||||
wikiOpenAction
|
||||
isGameRegistered
|
||||
);
|
||||
}
|
||||
if (isGameRegistered) {
|
||||
|
@@ -480,8 +480,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/outlineSize_black.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetOutlineSize")
|
||||
.SetGetter("GetOutlineSize");
|
||||
|
||||
@@ -494,8 +493,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/outlineSize_black.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetOutlineSize");
|
||||
|
||||
obj.AddExpression("OutlineSize",
|
||||
@@ -516,10 +514,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity (0-255)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetFillOpacity")
|
||||
.SetGetter("GetFillOpacity");
|
||||
|
||||
@@ -532,10 +527,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity to compare to (0-255)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetFillOpacity");
|
||||
|
||||
obj.AddExpression("FillOpacity",
|
||||
@@ -555,10 +547,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity (0-255)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetOutlineOpacity")
|
||||
.SetGetter("GetOutlineOpacity");
|
||||
|
||||
@@ -571,10 +560,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity to compare to (0-255)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetOutlineOpacity");
|
||||
|
||||
obj.AddExpression("OutlineOpacity",
|
||||
@@ -619,10 +605,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scale24_black.png",
|
||||
"res/actions/scale_black.png")
|
||||
.AddParameter("object", _("Object"), "Drawer")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddExpressionAndConditionAndAction("number",
|
||||
@@ -633,10 +616,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
_("Size"),
|
||||
"res/actions/scaleWidth24_black.png")
|
||||
.AddParameter("object", _("Object"), "Drawer")
|
||||
.UseStandardParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddExpressionAndConditionAndAction("number",
|
||||
@@ -647,10 +627,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
_("Size"),
|
||||
"res/actions/scaleHeight24_black.png")
|
||||
.AddParameter("object", _("Object"), "Drawer")
|
||||
.UseStandardParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("FlipX",
|
||||
@@ -701,8 +678,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleWidth24_black.png",
|
||||
"res/actions/scaleWidth_black.png")
|
||||
.AddParameter("object", _("Object"), "Drawer")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction("Height",
|
||||
@@ -713,8 +689,7 @@ void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleHeight24_black.png",
|
||||
"res/actions/scaleHeight_black.png")
|
||||
.AddParameter("object", _("Object"), "Drawer")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions())
|
||||
.UseStandardOperatorParameters("number")
|
||||
.MarkAsAdvanced();
|
||||
|
||||
obj.AddAction(
|
||||
|
@@ -108,7 +108,7 @@ void ShapePainterObjectBase::SetFillColor(unsigned int r,
|
||||
fillColorB = b;
|
||||
}
|
||||
|
||||
void ShapePainterObjectBase::SetFillOpacity(double val) {
|
||||
void ShapePainterObjectBase::SetFillOpacity(float val) {
|
||||
if (val > 255)
|
||||
val = 255;
|
||||
else if (val < 0)
|
||||
@@ -128,7 +128,7 @@ void ShapePainterObjectBase::SetOutlineColor(unsigned int r,
|
||||
outlineColorB = b;
|
||||
}
|
||||
|
||||
void ShapePainterObjectBase::SetOutlineOpacity(double val) {
|
||||
void ShapePainterObjectBase::SetOutlineOpacity(float val) {
|
||||
if (val > 255)
|
||||
val = 255;
|
||||
else if (val < 0)
|
||||
|
@@ -26,11 +26,11 @@ class GD_EXTENSION_API ShapePainterObjectBase {
|
||||
ShapePainterObjectBase();
|
||||
virtual ~ShapePainterObjectBase(){};
|
||||
|
||||
inline void SetOutlineSize(double size) { outlineSize = size; };
|
||||
inline double GetOutlineSize() const { return outlineSize; };
|
||||
inline void SetOutlineSize(float size) { outlineSize = size; };
|
||||
inline float GetOutlineSize() const { return outlineSize; };
|
||||
|
||||
void SetOutlineOpacity(double val);
|
||||
inline double GetOutlineOpacity() const { return outlineOpacity; };
|
||||
void SetOutlineOpacity(float val);
|
||||
inline float GetOutlineOpacity() const { return outlineOpacity; };
|
||||
|
||||
void SetOutlineColor(unsigned int r, unsigned int v, unsigned int b);
|
||||
inline unsigned int GetOutlineColorR() const { return outlineColorR; };
|
||||
@@ -41,8 +41,8 @@ class GD_EXTENSION_API ShapePainterObjectBase {
|
||||
*/
|
||||
void SetOutlineColor(const gd::String& color);
|
||||
|
||||
void SetFillOpacity(double val);
|
||||
inline double GetFillOpacity() const { return fillOpacity; };
|
||||
void SetFillOpacity(float val);
|
||||
inline float GetFillOpacity() const { return fillOpacity; };
|
||||
|
||||
void SetFillColor(unsigned int r, unsigned int v, unsigned int b);
|
||||
inline unsigned int GetFillColorR() const { return fillColorR; };
|
||||
|
@@ -39,9 +39,7 @@ void DeclareTextEntryObjectExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/textentryicon.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "TextEntry")
|
||||
.UseStandardOperatorParameters(
|
||||
"string",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(_("Text")))
|
||||
.UseStandardOperatorParameters("string")
|
||||
.SetFunctionName("SetString")
|
||||
.SetGetter("GetString");
|
||||
|
||||
@@ -54,9 +52,7 @@ void DeclareTextEntryObjectExtension(gd::PlatformExtension& extension) {
|
||||
"CppPlatform/Extensions/textentryicon.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "TextEntry")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(_("Text to compare to")))
|
||||
.UseStandardRelationalOperatorParameters("string")
|
||||
.SetFunctionName("GetString");
|
||||
|
||||
obj.AddAction(
|
||||
|
@@ -25,18 +25,16 @@ module.exports = {
|
||||
gd /*: libGDevelop */
|
||||
) {
|
||||
const extension = new gd.PlatformExtension();
|
||||
extension
|
||||
.setExtensionInformation(
|
||||
'TextInput',
|
||||
_('Text Input'),
|
||||
_('A text field the player can type text into.'),
|
||||
'Florian Rival',
|
||||
'MIT'
|
||||
)
|
||||
.setCategory('User interface');
|
||||
extension
|
||||
.addInstructionOrExpressionGroupMetadata(_('Text Input'))
|
||||
.setIcon('JsPlatform/Extensions/text_input.svg');
|
||||
extension.setExtensionInformation(
|
||||
'TextInput',
|
||||
_('Text Input'),
|
||||
_('A text field the player can type text into.'),
|
||||
'Florian Rival',
|
||||
'MIT'
|
||||
)
|
||||
.setCategory('User interface');
|
||||
extension.addInstructionOrExpressionGroupMetadata(_("Text Input"))
|
||||
.setIcon("JsPlatform/Extensions/text_input.svg");
|
||||
|
||||
const textInputObject = new gd.ObjectJsImplementation();
|
||||
// $FlowExpectedError - ignore Flow warning as we're creating an object
|
||||
@@ -277,7 +275,7 @@ module.exports = {
|
||||
const object = extension
|
||||
.addObject(
|
||||
'TextInputObject',
|
||||
_('Text input'),
|
||||
_('Text input (experimental)'),
|
||||
_('A text field the player can type text into.'),
|
||||
'JsPlatform/Extensions/text_input.svg',
|
||||
textInputObject
|
||||
@@ -301,10 +299,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'string',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(_('Text'))
|
||||
)
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('setString')
|
||||
.setGetter('getString');
|
||||
|
||||
@@ -319,10 +314,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'string',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(_('Text'))
|
||||
)
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('setPlaceholder')
|
||||
.setGetter('getPlaceholder');
|
||||
|
||||
@@ -337,7 +329,7 @@ module.exports = {
|
||||
'res/conditions/opacity24.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setFontSize')
|
||||
.setGetter('getFontSize');
|
||||
|
||||
@@ -352,7 +344,7 @@ module.exports = {
|
||||
'res/conditions/font24.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters('string', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('string')
|
||||
.setFunctionName('getFontResourceName');
|
||||
|
||||
// TODO: could this be merged with the previous expression and condition?
|
||||
@@ -382,10 +374,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'string',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(_('Input type'))
|
||||
) // TODO: stringWithSelector?
|
||||
.useStandardParameters('string') // TODO: stringWithSelector?
|
||||
.setFunctionName('setInputType')
|
||||
.setGetter('getInputType');
|
||||
|
||||
@@ -430,12 +419,7 @@ module.exports = {
|
||||
'res/conditions/opacity24.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Opacity (0-255)')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setFillOpacity')
|
||||
.setGetter('getFillOpacity');
|
||||
|
||||
@@ -465,12 +449,7 @@ module.exports = {
|
||||
'res/conditions/opacity24.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Opacity (0-255)')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setBorderOpacity')
|
||||
.setGetter('getBorderOpacity');
|
||||
|
||||
@@ -485,7 +464,7 @@ module.exports = {
|
||||
'res/conditions/outlineSize24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters('number', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setBorderWidth')
|
||||
.setGetter('getBorderWidth');
|
||||
|
||||
@@ -502,7 +481,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters('boolean', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('boolean')
|
||||
.setFunctionName('setReadOnly')
|
||||
.setGetter('isReadOnly');
|
||||
|
||||
@@ -517,7 +496,7 @@ module.exports = {
|
||||
'res/conditions/text24_black.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters('boolean', gd.ParameterOptions.makeNewOptions())
|
||||
.useStandardParameters('boolean')
|
||||
.setFunctionName('setDisabled')
|
||||
.setGetter('isDisabled');
|
||||
|
||||
@@ -533,12 +512,7 @@ module.exports = {
|
||||
'res/conditions/opacity24.png'
|
||||
)
|
||||
.addParameter('object', _('Text input'), 'TextInputObject', false)
|
||||
.useStandardParameters(
|
||||
'number',
|
||||
gd.ParameterOptions.makeNewOptions().setDescription(
|
||||
_('Opacity (0-255)')
|
||||
)
|
||||
)
|
||||
.useStandardParameters('number')
|
||||
.setFunctionName('setOpacity')
|
||||
.setGetter('getOpacity');
|
||||
|
||||
@@ -647,7 +621,8 @@ module.exports = {
|
||||
|
||||
update() {
|
||||
const instance = this._instance;
|
||||
const properties = this._associatedObjectConfiguration.getProperties();
|
||||
const properties = this._associatedObjectConfiguration
|
||||
.getProperties();
|
||||
|
||||
const placeholder =
|
||||
instance.getRawStringProperty('placeholder') ||
|
||||
|
@@ -45,9 +45,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/text_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"string",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(_("Text")))
|
||||
.UseStandardOperatorParameters("string")
|
||||
.SetFunctionName("SetString")
|
||||
.SetGetter("GetString");
|
||||
|
||||
@@ -60,10 +58,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/text_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"string",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Text to compare to")))
|
||||
.UseStandardRelationalOperatorParameters("string")
|
||||
.SetFunctionName("GetString");
|
||||
|
||||
obj.AddAction("Font",
|
||||
@@ -87,10 +82,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale to compare to (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetScaleX");
|
||||
|
||||
obj.AddAction(
|
||||
@@ -103,10 +95,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleWidth_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetScaleX");
|
||||
|
||||
obj.AddCondition("ScaleY",
|
||||
@@ -118,10 +107,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale to compare to (1 by default)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetScaleY");
|
||||
|
||||
obj.AddAction(
|
||||
@@ -134,10 +120,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scaleHeight_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetScaleY");
|
||||
|
||||
obj.AddAction(
|
||||
@@ -150,10 +133,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/scale_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Scale (1 by default)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetScale");
|
||||
|
||||
obj.AddAction(
|
||||
@@ -238,10 +218,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity (0-255)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetOpacity")
|
||||
.SetGetter("GetOpacity");
|
||||
|
||||
@@ -255,10 +232,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/opacity.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Opacity to compare to (0-255)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetOpacity");
|
||||
|
||||
obj.AddAction("SetSmooth",
|
||||
@@ -362,10 +336,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/rotate_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle (in degrees)")))
|
||||
.UseStandardOperatorParameters("number")
|
||||
.SetFunctionName("SetAngle")
|
||||
.SetGetter("GetAngle");
|
||||
|
||||
@@ -378,10 +349,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/rotate_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number",
|
||||
gd::ParameterOptions::MakeNewOptions().SetDescription(
|
||||
_("Angle to compare to (in degrees)")))
|
||||
.UseStandardRelationalOperatorParameters("number")
|
||||
.SetFunctionName("GetAngle");
|
||||
|
||||
obj.AddCondition("Padding",
|
||||
@@ -395,8 +363,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/textPadding_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddAction("SetPadding",
|
||||
_("Padding"),
|
||||
@@ -409,8 +376,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/textPadding_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddAction("SetTextAlignment",
|
||||
_("Alignment"),
|
||||
@@ -437,11 +403,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/textAlign.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"stringWithSelector",
|
||||
gd::ParameterOptions::MakeNewOptions()
|
||||
.SetDescription(_("Alignment"))
|
||||
.SetTypeExtraInfo("[\"left\", \"center\", \"right\"]"));
|
||||
.UseStandardRelationalOperatorParameters("string");
|
||||
|
||||
obj.AddAction(
|
||||
"SetWrapping",
|
||||
@@ -475,8 +437,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/actions/wordWrap_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardOperatorParameters("number",
|
||||
gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardOperatorParameters("number");
|
||||
|
||||
obj.AddCondition("WrappingWidth",
|
||||
_("Wrapping width"),
|
||||
@@ -487,8 +448,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"res/conditions/wordWrap_black.png")
|
||||
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardRelationalOperatorParameters(
|
||||
"number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardRelationalOperatorParameters("number");
|
||||
|
||||
obj.AddExpression("Padding",
|
||||
_("Padding"),
|
||||
@@ -537,7 +497,7 @@ void DeclareTextObjectExtension(gd::PlatformExtension& extension) {
|
||||
"",
|
||||
"res/conditions/characterSize24.png")
|
||||
.AddParameter("object", _("Object"), "Text")
|
||||
.UseStandardParameters("number", gd::ParameterOptions::MakeNewOptions());
|
||||
.UseStandardParameters("number");
|
||||
|
||||
// Support for deprecated "Size" actions/conditions:
|
||||
obj.AddDuplicatedAction("Size", "Text::SetFontSize").SetHidden();
|
||||
|
@@ -29,8 +29,7 @@ TextObject::TextObject()
|
||||
underlined(false),
|
||||
colorR(0),
|
||||
colorG(0),
|
||||
colorB(0),
|
||||
textAlignment("left")
|
||||
colorB(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,7 +39,6 @@ void TextObject::DoUnserializeFrom(gd::Project& project,
|
||||
const gd::SerializerElement& element) {
|
||||
SetString(element.GetChild("string", 0, "String").GetValue().GetString());
|
||||
SetFontName(element.GetChild("font", 0, "Font").GetValue().GetString());
|
||||
SetTextAlignment(element.GetChild("textAlignment").GetValue().GetString());
|
||||
SetCharacterSize(element.GetChild("characterSize", 0, "CharacterSize")
|
||||
.GetValue()
|
||||
.GetInt());
|
||||
@@ -58,7 +56,6 @@ void TextObject::DoUnserializeFrom(gd::Project& project,
|
||||
void TextObject::DoSerializeTo(gd::SerializerElement& element) const {
|
||||
element.AddChild("string").SetValue(GetString());
|
||||
element.AddChild("font").SetValue(GetFontName());
|
||||
element.AddChild("textAlignment").SetValue(GetTextAlignment());
|
||||
element.AddChild("characterSize").SetValue(GetCharacterSize());
|
||||
element.AddChild("color")
|
||||
.SetAttribute("r", (int)GetColorR())
|
||||
@@ -71,8 +68,7 @@ void TextObject::DoSerializeTo(gd::SerializerElement& element) const {
|
||||
element.SetAttribute("underlined", underlined);
|
||||
}
|
||||
|
||||
void TextObject::ExposeResources(
|
||||
gd::ArbitraryResourceWorker& worker) {
|
||||
void TextObject::ExposeResources(gd::ArbitraryResourceWorker& worker) {
|
||||
worker.ExposeFont(fontName);
|
||||
}
|
||||
#endif
|
||||
|
@@ -12,7 +12,7 @@ namespace gd {
|
||||
class Project;
|
||||
class Object;
|
||||
class InitialInstance;
|
||||
} // namespace gd
|
||||
}
|
||||
|
||||
/**
|
||||
* Text Object
|
||||
@@ -25,7 +25,9 @@ class GD_EXTENSION_API TextObject : public gd::ObjectConfiguration {
|
||||
return gd::make_unique<TextObject>(*this);
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
virtual void ExposeResources(gd::ArbitraryResourceWorker& worker);
|
||||
#endif
|
||||
|
||||
/** \brief Change the text.
|
||||
*/
|
||||
@@ -37,11 +39,11 @@ class GD_EXTENSION_API TextObject : public gd::ObjectConfiguration {
|
||||
|
||||
/** \brief Change the character size.
|
||||
*/
|
||||
inline void SetCharacterSize(double size) { characterSize = size; };
|
||||
inline void SetCharacterSize(float size) { characterSize = size; };
|
||||
|
||||
/** \brief Get the character size.
|
||||
*/
|
||||
inline double GetCharacterSize() const { return characterSize; };
|
||||
inline float GetCharacterSize() const { return characterSize; };
|
||||
|
||||
/** \brief Return the name of the font resource used for the text.
|
||||
*/
|
||||
@@ -51,11 +53,6 @@ class GD_EXTENSION_API TextObject : public gd::ObjectConfiguration {
|
||||
*/
|
||||
void SetFontName(const gd::String& resourceName) { fontName = resourceName; };
|
||||
|
||||
inline const gd::String& GetTextAlignment() const { return textAlignment; };
|
||||
void SetTextAlignment(const gd::String& textAlignment_) {
|
||||
textAlignment = textAlignment_;
|
||||
};
|
||||
|
||||
bool IsBold() const { return bold; };
|
||||
void SetBold(bool enable) { bold = enable; };
|
||||
bool IsItalic() const { return italic; };
|
||||
@@ -83,14 +80,13 @@ class GD_EXTENSION_API TextObject : public gd::ObjectConfiguration {
|
||||
#endif
|
||||
|
||||
gd::String text;
|
||||
double characterSize;
|
||||
float characterSize;
|
||||
gd::String fontName;
|
||||
bool smoothed;
|
||||
bool bold, italic, underlined;
|
||||
unsigned int colorR;
|
||||
unsigned int colorG;
|
||||
unsigned int colorB;
|
||||
gd::String textAlignment;
|
||||
};
|
||||
|
||||
#endif // TEXTOBJECT_H
|
||||
|
@@ -94,25 +94,7 @@ namespace gdjs {
|
||||
}
|
||||
|
||||
updatePosition(): void {
|
||||
if (this._object.isWrapping()) {
|
||||
const alignmentX =
|
||||
this._object._textAlign === 'right'
|
||||
? 1
|
||||
: this._object._textAlign === 'center'
|
||||
? 0.5
|
||||
: 0;
|
||||
|
||||
const width = this._object.getWrappingWidth();
|
||||
|
||||
// A vector from the custom size center to the renderer center.
|
||||
const centerToCenterX = (width - this._text.width) * (alignmentX - 0.5);
|
||||
|
||||
this._text.position.x = this._object.x + width / 2;
|
||||
this._text.anchor.x = 0.5 - centerToCenterX / this._text.width;
|
||||
} else {
|
||||
this._text.position.x = this._object.x + this._text.width / 2;
|
||||
this._text.anchor.x = 0.5;
|
||||
}
|
||||
this._text.position.x = this._object.x + this._text.width / 2;
|
||||
this._text.position.y = this._object.y + this._text.height / 2;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,6 @@ namespace gdjs {
|
||||
};
|
||||
/** The text of the object */
|
||||
string: string;
|
||||
textAlignment: string;
|
||||
};
|
||||
|
||||
export type TextObjectData = ObjectData & TextObjectDataType;
|
||||
@@ -83,7 +82,6 @@ namespace gdjs {
|
||||
textObjectData.color.b,
|
||||
];
|
||||
this._str = textObjectData.string;
|
||||
this._textAlign = textObjectData.textAlignment;
|
||||
this._renderer = new gdjs.TextRuntimeObjectRenderer(
|
||||
this,
|
||||
instanceContainer
|
||||
@@ -129,9 +127,6 @@ namespace gdjs {
|
||||
if (oldObjectData.underlined !== newObjectData.underlined) {
|
||||
return false;
|
||||
}
|
||||
if (oldObjectData.textAlignment !== newObjectData.textAlignment) {
|
||||
this.setTextAlignment(newObjectData.textAlignment);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -293,7 +288,7 @@ namespace gdjs {
|
||||
* Get width of the text.
|
||||
*/
|
||||
getWidth(): float {
|
||||
return this._wrapping ? this._wrappingWidth : this._renderer.getWidth();
|
||||
return this._renderer.getWidth();
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -60,20 +60,17 @@ namespace gdjs {
|
||||
/**
|
||||
* @param tileMapJsonResourceName The resource name of the tile map.
|
||||
* @param tileSetJsonResourceName The resource name of the tile set.
|
||||
* @param levelIndex The level of the tile map.
|
||||
* @param callback A function called when the tile map is parsed.
|
||||
*/
|
||||
getOrLoadTileMap(
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
levelIndex: number,
|
||||
callback: (tileMap: TileMapHelper.EditableTileMap | null) => void
|
||||
): void {
|
||||
this._manager.getOrLoadTileMap(
|
||||
this._loadTileMap.bind(this),
|
||||
this._loadTiledMap.bind(this),
|
||||
tileMapJsonResourceName,
|
||||
tileSetJsonResourceName,
|
||||
levelIndex,
|
||||
pako,
|
||||
callback
|
||||
);
|
||||
@@ -84,7 +81,6 @@ namespace gdjs {
|
||||
* @param atlasImageResourceName The resource name of the atlas image.
|
||||
* @param tileMapJsonResourceName The resource name of the tile map.
|
||||
* @param tileSetJsonResourceName The resource name of the tile set.
|
||||
* @param levelIndex The level of the tile map.
|
||||
* @param callback A function called when the tiles textures are split.
|
||||
*/
|
||||
getOrLoadTextureCache(
|
||||
@@ -92,16 +88,14 @@ namespace gdjs {
|
||||
atlasImageResourceName: string,
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
levelIndex: number,
|
||||
callback: (textureCache: TileMapHelper.TileTextureCache | null) => void
|
||||
): void {
|
||||
this._manager.getOrLoadTextureCache(
|
||||
this._loadTileMap.bind(this),
|
||||
this._loadTiledMap.bind(this),
|
||||
getTexture,
|
||||
atlasImageResourceName,
|
||||
tileMapJsonResourceName,
|
||||
tileSetJsonResourceName,
|
||||
levelIndex,
|
||||
callback
|
||||
);
|
||||
}
|
||||
@@ -110,10 +104,10 @@ namespace gdjs {
|
||||
* Parse both JSON and set the content of the tile set in the right
|
||||
* attribute in the tile map to merge both parsed data.
|
||||
*/
|
||||
private _loadTileMap(
|
||||
private _loadTiledMap(
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
callback: (tileMap: TileMapHelper.TileMap | null) => void
|
||||
callback: (tiledMap: TileMapHelper.TiledMap | null) => void
|
||||
): void {
|
||||
this._instanceContainer
|
||||
.getGame()
|
||||
@@ -127,14 +121,8 @@ namespace gdjs {
|
||||
callback(null);
|
||||
return;
|
||||
}
|
||||
const tileMap = TileMapHelper.TileMapManager.identify(
|
||||
tileMapJsonData
|
||||
);
|
||||
if (!tileMap) {
|
||||
callback(null);
|
||||
return;
|
||||
}
|
||||
if (tileMap.kind === 'tiled' && tileSetJsonResourceName) {
|
||||
const tiledMap = tileMapJsonData as TileMapHelper.TiledMap;
|
||||
if (tileSetJsonResourceName) {
|
||||
this._instanceContainer
|
||||
.getGame()
|
||||
.getJsonManager()
|
||||
@@ -147,14 +135,13 @@ namespace gdjs {
|
||||
callback(null);
|
||||
return;
|
||||
}
|
||||
const tiledMap = tileMap.data;
|
||||
const tileSet = tileSetJsonData as TileMapHelper.TiledTileset;
|
||||
tileSet.firstgid = tiledMap.tilesets[0].firstgid;
|
||||
tiledMap.tilesets = [tileSet];
|
||||
callback(tileMap);
|
||||
callback(tiledMap);
|
||||
});
|
||||
} else {
|
||||
callback(tileMap);
|
||||
callback(tiledMap);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -580,7 +580,7 @@ namespace gdjs {
|
||||
if (!definition) {
|
||||
continue;
|
||||
}
|
||||
if (definition.hasTaggedHitBox(this.tag)) {
|
||||
if (definition.hasTag(this.tag)) {
|
||||
polygonItr = tile.getHitboxes()[Symbol.iterator]();
|
||||
listNext = polygonItr.next();
|
||||
}
|
||||
@@ -661,7 +661,7 @@ namespace gdjs {
|
||||
*/
|
||||
getDefinition(): TileMapHelper.TileDefinition {
|
||||
return this.layer.tileMap.getTileDefinition(
|
||||
this.layer._source.getTileId(this.x, this.y)!
|
||||
this.layer._source.get(this.x, this.y)!
|
||||
)!;
|
||||
}
|
||||
|
||||
|
24
Extensions/TileMap/helper/TileMapHelper.d.ts
vendored
24
Extensions/TileMap/helper/TileMapHelper.d.ts
vendored
@@ -1,25 +1,23 @@
|
||||
import {
|
||||
EditableTileMap,
|
||||
EditableTileMapLayer,
|
||||
PixiTileMapHelper,
|
||||
TileDefinition,
|
||||
TileMap,
|
||||
TiledMap,
|
||||
TiledTileset,
|
||||
TileMapManager,
|
||||
TileTextureCache,
|
||||
TiledTileset,
|
||||
PixiTileMapHelper,
|
||||
} from './dts/index';
|
||||
|
||||
declare global {
|
||||
namespace TileMapHelper {
|
||||
export {
|
||||
EditableTileMap,
|
||||
EditableTileMapLayer,
|
||||
PixiTileMapHelper,
|
||||
TileDefinition,
|
||||
TileMap,
|
||||
TileMapManager,
|
||||
TileTextureCache,
|
||||
TiledTileset,
|
||||
};
|
||||
export { EditableTileMap };
|
||||
export { EditableTileMapLayer };
|
||||
export { TileDefinition };
|
||||
export { TiledMap };
|
||||
export { TiledTileset };
|
||||
export { TileMapManager };
|
||||
export { TileTextureCache };
|
||||
export { PixiTileMapHelper };
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
19
Extensions/TileMap/helper/dts/index.d.ts
vendored
19
Extensions/TileMap/helper/dts/index.d.ts
vendored
@@ -2,15 +2,22 @@
|
||||
* @packageDocumentation
|
||||
* @module TileMapHelper
|
||||
*/
|
||||
export {
|
||||
import { TiledMap, TiledTileset } from './tiled/TiledFormat';
|
||||
import {
|
||||
EditableTileMap,
|
||||
EditableTileMapLayer,
|
||||
TileDefinition,
|
||||
} from './model/TileMapModel';
|
||||
export { TileMapManager } from './render/TileMapManager';
|
||||
export { TileTextureCache } from './render/TileTextureCache';
|
||||
export { PixiTileMapHelper } from './render/TileMapPixiHelper';
|
||||
export * from './types/index';
|
||||
import { TileMapManager } from './render/TileMapManager';
|
||||
import { TileTextureCache } from './render/TileTextureCache';
|
||||
import { PixiTileMapHelper } from './render/TileMapPixiHelper';
|
||||
export * from './model/CommonTypes';
|
||||
export { TiledTileset } from './load/tiled/TiledFormat';
|
||||
export { EditableTileMap };
|
||||
export { EditableTileMapLayer };
|
||||
export { TileDefinition };
|
||||
export { TiledMap };
|
||||
export { TiledTileset };
|
||||
export { TileMapManager };
|
||||
export { TileTextureCache };
|
||||
export { PixiTileMapHelper };
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
@@ -1,18 +0,0 @@
|
||||
import type { EditableTileMap } from '../model/TileMapModel';
|
||||
import { TileMap } from '../types';
|
||||
export declare namespace TileMapLoader {
|
||||
/**
|
||||
* Create a {@link EditableTileMap} from the raw data.
|
||||
*
|
||||
* @param tiledMap The data exported from Tiled/LDtk.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @param pako The zlib library.
|
||||
* @returns A {@link EditableTileMap}
|
||||
*/
|
||||
function load(
|
||||
tileMap: TileMap,
|
||||
levelIndex: number,
|
||||
pako: any
|
||||
): EditableTileMap | null;
|
||||
}
|
||||
//# sourceMappingURL=TileMapLoader.d.ts.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"TileMapLoader.d.ts","sourceRoot":"","sources":["../../src/load/TileMapLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAInC,yBAAiB,aAAa,CAAC;IAC7B;;;;;;;OAOG;IACH,SAAgB,IAAI,CAClB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,GAAG,GACR,eAAe,GAAG,IAAI,CAaxB;CACF"}
|
@@ -1,589 +0,0 @@
|
||||
import { integer } from '../../model/CommonTypes';
|
||||
/**
|
||||
* version 1.1.3 - https://github.com/deepnight/ldtk/blob/66fff7199932357f3ab9b044c2fc2a856f527831/docs/JSON_SCHEMA.json
|
||||
*/
|
||||
export type LDtkTileMap = {
|
||||
/** LDtk application build identifier.<br/> This is only used to identify the LDtk version that generated this particular project file, which can be useful for specific bug fixing. Note that the build identifier is just the date of the release, so it's not unique to each user (one single global ID per LDtk public release), and as a result, completely anonymous. */
|
||||
appBuildId: number;
|
||||
/** Number of backup files to keep, if the `backupOnSave` is TRUE */
|
||||
backupLimit: integer;
|
||||
/** If TRUE, an extra copy of the project will be created in a sub folder, when saving. */
|
||||
backupOnSave: boolean;
|
||||
/** Project background color */
|
||||
bgColor: string;
|
||||
/** Default grid size for new layers */
|
||||
defaultGridSize: integer;
|
||||
/** Default background color of levels */
|
||||
defaultLevelBgColor: string;
|
||||
/** **WARNING**: this field will move to the `worlds` array after the \"multi-worlds\" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable the change immediately.<br/><br/> Default new level height */
|
||||
defaultLevelHeight: integer | null;
|
||||
/** **WARNING**: this field will move to the `worlds` array after the \"multi-worlds\" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable the change immediately.<br/><br/> Default new level width */
|
||||
defaultLevelWidth: integer | null;
|
||||
/** Default X pivot (0 to 1) for new entities */
|
||||
defaultPivotX: number;
|
||||
/** Default Y pivot (0 to 1) for new entities */
|
||||
defaultPivotY: number;
|
||||
/** A structure containing all the definitions of this project */
|
||||
defs: LDtkDefinition;
|
||||
/** **WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced by: `imageExportMode` */
|
||||
exportPng: boolean | null;
|
||||
/** If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file (default is FALSE) */
|
||||
exportTiled: boolean;
|
||||
/** If TRUE, one file will be saved for the project (incl. all its definitions) and one file in a sub-folder for each level. */
|
||||
externalLevels: boolean;
|
||||
/** An array containing various advanced flags (ie. options or other states). Possible values: `DiscardPreCsvIntGrid`, `ExportPreCsvIntGridFormat`, `IgnoreBackupSuggest`, `PrependIndexToLevelFileNames`, `MultiWorlds`, `UseMultilinesType` */
|
||||
flags: LDtkFlag[];
|
||||
/** Naming convention for Identifiers (first-letter uppercase, full uppercase etc.) Possible values: `Capitalize`, `Uppercase`, `Lowercase`, `Free` */
|
||||
identifierStyle: 'Capitalize' | 'Uppercase' | 'Lowercase' | 'Free';
|
||||
/** \"Image export\" option when saving project. Possible values: `None`, `OneImagePerLayer`, `OneImagePerLevel`, `LayersAndLevels` */
|
||||
imageExportMode:
|
||||
| 'None'
|
||||
| 'OneImagePerLayer'
|
||||
| 'OneImagePerLevel'
|
||||
| 'LayersAndLevels';
|
||||
/** File format version */
|
||||
jsonVersion: string;
|
||||
/** The default naming convention for level identifiers. */
|
||||
levelNamePattern: string;
|
||||
/** All levels. The order of this array is only relevant in `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value).<br/> Otherwise, you should refer to the `worldX`,`worldY` coordinates of each Level. */
|
||||
levels: LDtkLevel[];
|
||||
/** If TRUE, the Json is partially minified (no indentation, nor line breaks, default is FALSE) */
|
||||
minifyJson: boolean;
|
||||
/** Next Unique integer ID available */
|
||||
nextUid: integer;
|
||||
/** File naming pattern for exported PNGs */
|
||||
pngFilePattern: string | null;
|
||||
/** If TRUE, a very simplified will be generated on saving, for quicker & easier engine integration. */
|
||||
simplifiedExport: boolean;
|
||||
/** This optional description is used by LDtk Samples to show up some informations and instructions. */
|
||||
tutorialDesc: string | null;
|
||||
/** This array is not used yet in current LDtk version (so, for now, it's always empty).<br/><br/>In a later update, it will be possible to have multiple Worlds in a single project, each containing multiple Levels.<br/><br/>What will change when \"Multiple worlds\" support will be added to LDtk:<br/><br/> - in current version, a LDtk project file can only contain a single world with multiple levels in it. In this case, levels and world layout related settings are stored in the root of the JSON.<br/> - after the \"Multiple worlds\" update, there will be a `worlds` array in root, each world containing levels and layout settings. Basically, it's pretty much only about moving the `levels` array to the `worlds` array, along with world layout related values (eg. `worldGridWidth` etc).<br/><br/>If you want to start supporting this future update easily, please refer to this documentation: https://github.com/deepnight/ldtk/issues/231 */
|
||||
worlds: LDtkWorld[];
|
||||
/** **WARNING**: this field will move to the `worlds` array after the \"multi-worlds\" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable the change immediately.<br/><br/> Height of the world grid in pixels. */
|
||||
worldGridHeight: integer | null;
|
||||
/** **WARNING**: this field will move to the `worlds` array after the \"multi-worlds\" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable the change immediately.<br/><br/> Width of the world grid in pixels. */
|
||||
worldGridWidth: integer | null;
|
||||
/** **WARNING**: this field will move to the `worlds` array after the \"multi-worlds\" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable the change immediately.<br/><br/> An enum that describes how levels are organized in this project (ie. linearly or in a 2D space). Possible values: <`null`>, `Free`, `GridVania`, `LinearHorizontal`, `LinearVertical` */
|
||||
worldLayout:
|
||||
| 'Free'
|
||||
| 'GridVania'
|
||||
| 'LinearHorizontal'
|
||||
| 'LinearVertical'
|
||||
| null;
|
||||
};
|
||||
/** Auto-layer rule group */
|
||||
type LDtkAutoLayerRuleGroup = {
|
||||
/** */
|
||||
active: boolean;
|
||||
/** *This field was removed in 1.0.0 and should no longer be used.* */
|
||||
collapsed: boolean | null;
|
||||
/** */
|
||||
isOptional: boolean;
|
||||
/** */
|
||||
name: string;
|
||||
/** */
|
||||
rules: LDtkAutoRuleDef[];
|
||||
/** */
|
||||
uid: integer;
|
||||
};
|
||||
/** This complex section isn't meant to be used by game devs at all, as these rules are completely resolved internally by the editor before any saving. You should just ignore this part. */
|
||||
type LDtkAutoRuleDef = {};
|
||||
/** If you're writing your own LDtk importer, you should probably just ignore *most* stuff in the `defs` section, as it contains data that are mostly important to the editor. To keep you away from the `defs` section and avoid some unnecessary JSON parsing, important data from definitions is often duplicated in fields prefixed with a double underscore (eg. `__identifier` or `__type`). The 2 only definition types you might need here are **Tilesets** and **Enums**. */
|
||||
type LDtkDefinition = {
|
||||
/** All entities definitions, including their custom fields */
|
||||
entities: LDtkEntityDef[];
|
||||
/** All internal enums */
|
||||
enums: LDtkEnumDef[];
|
||||
/** Note: external enums are exactly the same as `enums`, except they have a `relPath` to point to an external source file. */
|
||||
externalEnums: LDtkEnumDef[];
|
||||
/** All layer definitions */
|
||||
layers: LDtkLayerDef[];
|
||||
/** All custom fields available to all levels. */
|
||||
levelFields: LDtkFieldDef[];
|
||||
/** All tilesets */
|
||||
tilesets: LDtkTilesetDef[];
|
||||
};
|
||||
/** Entity definition */
|
||||
type LDtkEntityDef = {
|
||||
/** Base entity color */
|
||||
color: string;
|
||||
/** Array of field definitions */
|
||||
fieldDefs: LDtkFieldDef[];
|
||||
/** */
|
||||
fillOpacity: number;
|
||||
/** Pixel height */
|
||||
height: integer;
|
||||
/** */
|
||||
hollow: boolean;
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** Only applies to entities resizable on both X/Y. If TRUE, the entity instance width/height will keep the same aspect ratio as the definition. */
|
||||
keepAspectRatio: boolean;
|
||||
/** Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne` */
|
||||
limitBehavior: 'DiscardOldOnes' | 'MoveLastOne' | 'PreventAdding';
|
||||
/** If TRUE, the maxCount is a \"per world\" limit, if FALSE, it's a \"per level\". Possible values: `PerLayer`, `PerLevel`, `PerWorld` */
|
||||
limitScope: 'PerLayer' | 'PerLevel' | 'PerWorld';
|
||||
/** */
|
||||
lineOpacity: number;
|
||||
/** Max instances count */
|
||||
maxCount: integer;
|
||||
/** An array of 4 dimensions for the up/right/down/left borders (in this order) when using 9-slice mode for `tileRenderMode`.<br/> If the tileRenderMode is not NineSlice, then this array is empty.<br/> See: https://en.wikipedia.org/wiki/9-slice_scaling */
|
||||
nineSliceBorders: integer[];
|
||||
/** Pivot X coordinate (from 0 to 1.0) */
|
||||
pivotX: number;
|
||||
/** Pivot Y coordinate (from 0 to 1.0) */
|
||||
pivotY: number;
|
||||
/** Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross` */
|
||||
renderMode: 'Cross' | 'Ellipse' | 'Rectangle' | 'Ellipse';
|
||||
/** If TRUE, the entity instances will be resizable horizontally */
|
||||
resizableX: boolean;
|
||||
/** If TRUE, the entity instances will be resizable vertically */
|
||||
resizableY: boolean;
|
||||
/** Display entity name in editor */
|
||||
showName: boolean;
|
||||
/** An array of strings that classifies this entity */
|
||||
tags: string[];
|
||||
/** **WARNING**: this deprecated value will be *removed* completely on version 1.2.0+ Replaced by: `tileRect` */
|
||||
tileId: integer | null;
|
||||
/** */
|
||||
tileOpacity: number;
|
||||
/** An object representing a rectangle from an existing Tileset */
|
||||
tileRect: LDtkTilesetRect | null;
|
||||
/** An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, `FullSizeUncropped`, `NineSlice` */
|
||||
tileRenderMode:
|
||||
| 'Cover'
|
||||
| 'FitInside'
|
||||
| 'FullSizeCropped'
|
||||
| 'FullSizeUncropped'
|
||||
| 'NineSlice'
|
||||
| 'Repeat'
|
||||
| 'Stretch';
|
||||
/** Tileset ID used for optional tile display */
|
||||
tilesetId: integer | null;
|
||||
/** Unique Int identifier */
|
||||
uid: integer;
|
||||
/** Pixel width */
|
||||
width: integer;
|
||||
};
|
||||
/** Entity instance */
|
||||
type LDtkEntityInstance = {
|
||||
/** Grid-based coordinates (`[x,y]` format) */
|
||||
__grid: integer[];
|
||||
/** Entity definition identifier */
|
||||
__identifier: string;
|
||||
/** Pivot coordinates (`[x,y]` format, values are from 0 to 1) of the Entity */
|
||||
__pivot: number[];
|
||||
/** The entity \"smart\" color, guessed from either Entity definition, or one its field instances. */
|
||||
__smartColor: string;
|
||||
/** Array of tags defined in this Entity definition */
|
||||
__tags: string[];
|
||||
/** Optional TilesetRect used to display this entity (it could either be the default Entity tile, or some tile provided by a field value, like an Enum). */
|
||||
__tile: LDtkTilesetRect | null;
|
||||
/** Reference of the **Entity definition** UID */
|
||||
defUid: integer;
|
||||
/** An array of all custom fields and their values. */
|
||||
fieldInstances: LDtkFieldInstance[];
|
||||
/** Entity height in pixels. For non-resizable entities, it will be the same as Entity definition. */
|
||||
height: integer;
|
||||
/** Unique instance identifier */
|
||||
iid: string;
|
||||
/** Pixel coordinates (`[x,y]` format) in current level coordinate space. Don't forget optional layer offsets, if they exist! */
|
||||
px: integer[];
|
||||
/** Entity width in pixels. For non-resizable entities, it will be the same as Entity definition. */
|
||||
width: integer;
|
||||
};
|
||||
/** Enum definition */
|
||||
type LDtkEnumDef = {
|
||||
/** */
|
||||
externalFileChecksum: string | null;
|
||||
/** Relative path to the external file providing this Enum */
|
||||
externalRelPath: string | null;
|
||||
/** Tileset UID if provided */
|
||||
iconTilesetUid: integer | null;
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** An array of user-defined tags to organize the Enums */
|
||||
tags: string[];
|
||||
/** Unique Int identifier */
|
||||
uid: integer;
|
||||
/** All possible enum values, with their optional Tile infos. */
|
||||
values: LDtkEnumDefValues[];
|
||||
};
|
||||
/** Enum value definition */
|
||||
type LDtkEnumDefValues = {
|
||||
/** An array of 4 Int values that refers to the tile in the tileset image: `[ x, y, width, height ]` */
|
||||
__tileSrcRect: integer[] | null;
|
||||
/** Optional color */
|
||||
color: integer;
|
||||
/** Enum value */
|
||||
id: string;
|
||||
/** The optional ID of the tile */
|
||||
tileId: integer | null;
|
||||
};
|
||||
/** In a tileset definition, enum based tag infos */
|
||||
type LDtkEnumTagValue = {
|
||||
/** */
|
||||
enumValueId: string;
|
||||
/** */
|
||||
tileIds: integer[];
|
||||
};
|
||||
/** This section is mostly only intended for the LDtk editor app itself. You can safely ignore it. */
|
||||
type LDtkFieldDef = {
|
||||
/** Human readable value type. Possible values: `Int, Float, String, Bool, Color, ExternEnum.XXX, LocalEnum.XXX, Point, FilePath`.<br/> If the field is an array, this field will look like `Array<...>` (eg. `Array<Int>`, `Array<Point>` etc.)<br/> NOTE: if you enable the advanced option **Use Multilines type**, you will have \"*Multilines*\" instead of \"*String*\" when relevant. */
|
||||
__type: string;
|
||||
/** Optional list of accepted file extensions for FilePath value type. Includes the dot: `.ext` */
|
||||
acceptFileTypes: string[] | null;
|
||||
/** Possible values: `Any`, `OnlySame`, `OnlyTags` */
|
||||
allowedRefs: 'Any' | 'OnlySame' | 'OnlyTags';
|
||||
/** */
|
||||
allowedRefTags: string[];
|
||||
/** */
|
||||
allowOutOfLevelRef: boolean;
|
||||
/** Array max length */
|
||||
arrayMaxLength: integer | null;
|
||||
/** Array min length */
|
||||
arrayMinLength: integer | null;
|
||||
/** */
|
||||
autoChainRef: boolean;
|
||||
/** TRUE if the value can be null. For arrays, TRUE means it can contain null values (exception: array of Points can't have null values). */
|
||||
canBeNull: boolean;
|
||||
/** Default value if selected value is null or invalid. */
|
||||
defaultOverride: any | null;
|
||||
/** */
|
||||
editorAlwaysShow: boolean;
|
||||
/** */
|
||||
editorCutLongValues: boolean;
|
||||
/** Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, `RefLinkBetweenCenters` */
|
||||
editorDisplayMode:
|
||||
| 'ArrayCountNoLabel'
|
||||
| 'ArrayCountWithLabel'
|
||||
| 'EntityTile'
|
||||
| 'Hidden'
|
||||
| 'NameAndValue'
|
||||
| 'PointPath'
|
||||
| 'PointPathLoop'
|
||||
| 'PointStar'
|
||||
| 'Points'
|
||||
| 'RadiusGrid'
|
||||
| 'RadiusPx'
|
||||
| 'RefLinkBetweenCenters'
|
||||
| 'RefLinkBetweenPivots'
|
||||
| 'ValueOnly';
|
||||
/** Possible values: `Above`, `Center`, `Beneath` */
|
||||
editorDisplayPos: 'Above' | 'Beneath' | 'Center';
|
||||
/** */
|
||||
editorTextPrefix: string | null;
|
||||
/** */
|
||||
editorTextSuffix: string | null;
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** TRUE if the value is an array of multiple values */
|
||||
isArray: boolean;
|
||||
/** Max limit for value, if applicable */
|
||||
max: number | null;
|
||||
/** Min limit for value, if applicable */
|
||||
min: number | null;
|
||||
/** Optional regular expression that needs to be matched to accept values. Expected format: `/some_reg_ex/g`, with optional \"i\" flag. */
|
||||
regex: string | null;
|
||||
/** */
|
||||
symmetricalRef: boolean;
|
||||
/** Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`, `LangHaxe`, `LangMarkdown`, `LangJson`, `LangXml`, `LangLog` */
|
||||
textLanguageMode:
|
||||
| 'LangC'
|
||||
| 'LangHaxe'
|
||||
| 'LangJS'
|
||||
| 'LangJson'
|
||||
| 'LangLog'
|
||||
| 'LangLua'
|
||||
| 'LangMarkdown'
|
||||
| 'LangPython'
|
||||
| 'LangRuby'
|
||||
| 'LangXml'
|
||||
| null;
|
||||
/** UID of the tileset used for a Tile */
|
||||
tilesetUid: integer | null;
|
||||
/** Internal enum representing the possible field types. Possible values: F_Int, F_Float, F_String, F_Text, F_Bool, F_Color, F_Enum(...), F_Point, F_Path, F_EntityRef, F_Tile */
|
||||
type: string;
|
||||
/** Unique Int identifier */
|
||||
uid: integer;
|
||||
/** If TRUE, the color associated with this field will override the Entity or Level default color in the editor UI. For Enum fields, this would be the color associated to their values. */
|
||||
useForSmartColor: boolean;
|
||||
};
|
||||
/** Field instance */
|
||||
type LDtkFieldInstance = {
|
||||
/** Field definition identifier */
|
||||
__identifier: string;
|
||||
/** Optional TilesetRect used to display this field (this can be the field own Tile, or some other Tile guessed from the value, like an Enum). */
|
||||
__tile: LDtkTilesetRect | null;
|
||||
/** Type of the field, such as `Int`, `Float`, `String`, `Enum(my_enum_name)`, `Bool`, etc.<br/> NOTE: if you enable the advanced option **Use Multilines type**, you will have \"*Multilines*\" instead of \"*String*\" when relevant. */
|
||||
__type: string;
|
||||
/** Actual value of the field instance. The value type varies, depending on `__type`:<br/> - For **classic types** (ie. Integer, Float, Boolean, String, Text and FilePath), you just get the actual value with the expected type.<br/> - For **Color**, the value is an hexadecimal string using \"#rrggbb\" format.<br/> - For **Enum**, the value is a String representing the selected enum value.<br/> - For **Point**, the value is a [GridPoint](#ldtk-GridPoint) object.<br/> - For **Tile**, the value is a [TilesetRect](#ldtk-TilesetRect) object.<br/> - For **EntityRef**, the value is an [EntityReferenceInfos](#ldtk-EntityReferenceInfos) object.<br/><br/> If the field is an array, then this `__value` will also be a JSON array. */
|
||||
__value: any;
|
||||
/** Reference of the **Field definition** UID */
|
||||
defUid: integer;
|
||||
/** Editor internal raw values */
|
||||
realEditorValues: any[];
|
||||
};
|
||||
type LDtkFlag =
|
||||
| 'DiscardPreCsvIntGrid'
|
||||
| 'ExportPreCsvIntGridFormat'
|
||||
| 'IgnoreBackupSuggest'
|
||||
| 'PrependIndexToLevelFileNames'
|
||||
| 'MultiWorlds'
|
||||
| 'UseMultilinesType';
|
||||
/** IntGrid value definition */
|
||||
type LDtkIntGridValueDef = {
|
||||
/** */
|
||||
color: string;
|
||||
/** User defined unique identifier */
|
||||
identifier: string | null;
|
||||
/** The IntGrid value itself */
|
||||
value: integer;
|
||||
};
|
||||
/** IntGrid value instance */
|
||||
type LDtkIntGridValueInstance = {
|
||||
/** Coordinate ID in the layer grid */
|
||||
coordId: integer;
|
||||
/** IntGrid value */
|
||||
v: integer;
|
||||
};
|
||||
/** Layer definition */
|
||||
type LDtkLayerDef = {
|
||||
/** Type of the layer (*IntGrid, Entities, Tiles or AutoLayer*) */
|
||||
__type: string;
|
||||
/** Contains all the auto-layer rule definitions. */
|
||||
autoRuleGroups: LDtkAutoLayerRuleGroup[];
|
||||
/** */
|
||||
autoSourceLayerDefUid: integer | null;
|
||||
/** **WARNING**: this deprecated value will be *removed* completely on version 1.2.0+ Replaced by: `tilesetDefUid` */
|
||||
autoTilesetDefUid: integer | null;
|
||||
/** Opacity of the layer (0 to 1.0) */
|
||||
displayOpacity: number;
|
||||
/** An array of tags to forbid some Entities in this layer */
|
||||
excludedTags: string[];
|
||||
/** Width and height of the grid in pixels*/
|
||||
gridSize: integer;
|
||||
/** Height of the optional \"guide\" grid in pixels */
|
||||
guideGridHei: integer;
|
||||
/** Width of the optional \"guide\" grid in pixels */
|
||||
guideGridWid: integer;
|
||||
/** */
|
||||
hideFieldsWhenInactive: boolean;
|
||||
/** Hide the layer from the list on the side of the editor view. */
|
||||
hideInList: boolean;
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** Alpha of this layer when it is not the active one. */
|
||||
inactiveOpacity: number;
|
||||
/** An array that defines extra optional info for each IntGrid value.<br/> WARNING: the array order is not related to actual IntGrid values! As user can re-order IntGrid values freely, you may value \"2\" before value \"1\" in this array. */
|
||||
intGridValues: LDtkIntGridValueDef[];
|
||||
/** Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect. */
|
||||
parallaxFactorX: number;
|
||||
/** Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect. */
|
||||
parallaxFactorY: number;
|
||||
/** If true (default), a layer with a parallax factor will also be scaled up/down accordingly. */
|
||||
parallaxScaling: boolean;
|
||||
/** X offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` optional offset) */
|
||||
pxOffsetX: integer;
|
||||
/** Y offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` optional offset) */
|
||||
pxOffsetY: integer;
|
||||
/** An array of tags to filter Entities that can be added to this layer */
|
||||
requiredTags: string[];
|
||||
/** If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell. */
|
||||
tilePivotX: number;
|
||||
/** If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell.*/
|
||||
tilePivotY: number;
|
||||
/** Reference to the default Tileset UID being used by this layer definition.<br/> **WARNING**: some layer *instances* might use a different tileset. So most of the time, you should probably use the `__tilesetDefUid` value found in layer instances.<br/> Note: since version 1.0.0, the old `autoTilesetDefUid` was removed and merged into this value. */
|
||||
tilesetDefUid: integer | null;
|
||||
/** Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, `AutoLayer` */
|
||||
type: 'AutoLayer' | 'Entities' | 'IntGrid' | 'Tiles';
|
||||
/** Unique Int identifier */
|
||||
uid: integer;
|
||||
};
|
||||
/** Layer instance */
|
||||
type LDtkLayerInstance = {
|
||||
/** Grid-based height */
|
||||
__cHei: integer;
|
||||
/** Grid-based width */
|
||||
__cWid: integer;
|
||||
/** Grid size */
|
||||
__gridSize: integer;
|
||||
/** Layer definition identifier */
|
||||
__identifier: string;
|
||||
/** Layer opacity as Float [0-1] */
|
||||
__opacity: number;
|
||||
/** Total layer X pixel offset, including both instance and definition offsets. */
|
||||
__pxTotalOffsetX: integer;
|
||||
/** Total layer Y pixel offset, including both instance and definition offsets. */
|
||||
__pxTotalOffsetY: integer;
|
||||
/** The definition UID of corresponding Tileset, if any. */
|
||||
__tilesetDefUid: integer | null;
|
||||
/** The relative path to corresponding Tileset, if any. */
|
||||
__tilesetRelPath: string | null;
|
||||
/** Layer type (possible values: IntGrid, Entities, Tiles or AutoLayer) */
|
||||
__type: string;
|
||||
/** An array containing all tiles generated by Auto-layer rules. The array is already sorted in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).<br/><br/> Note: if multiple tiles are stacked in the same cell as the result of different rules, all tiles behind opaque ones will be discarded. */
|
||||
autoLayerTiles: LDtkTile[];
|
||||
/** */
|
||||
entityInstances: LDtkEntityInstance[];
|
||||
/** */
|
||||
gridTiles: LDtkTile[];
|
||||
/** Unique layer instance identifier */
|
||||
iid: string;
|
||||
/** **WARNING**: this deprecated value is no longer exported since version 1.0.0 Replaced by: `intGridCsv` */
|
||||
intGrid: LDtkIntGridValueInstance[] | null;
|
||||
/** A list of all values in the IntGrid layer, stored in CSV format (Comma Separated Values).<br/> Order is from left to right, and top to bottom (ie. first row from left to right, followed by second row, etc).<br/> `0` means \"empty cell\" and IntGrid values start at 1.<br/> The array size is `__cWid` x `__cHei` cells. */
|
||||
intGridCsv: integer[];
|
||||
/** Reference the Layer definition UID */
|
||||
layerDefUid: integer;
|
||||
/** Reference to the UID of the level containing this layer instance */
|
||||
levelId: integer;
|
||||
/** An Array containing the UIDs of optional rules that were enabled in this specific layer instance. */
|
||||
optionalRules: integer[];
|
||||
/** This layer can use another tileset by overriding the tileset UID here. */
|
||||
overrideTilesetUid: integer | null;
|
||||
/** X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to the `LayerDef` optional offset, see `__pxTotalOffsetX`) */
|
||||
pxOffsetX: integer;
|
||||
/** Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to the `LayerDef` optional offset, see `__pxTotalOffsetY`) */
|
||||
pxOffsetY: integer;
|
||||
/** Random seed used for Auto-Layers rendering */
|
||||
seed: integer;
|
||||
/** Layer instance visibility */
|
||||
visible: boolean;
|
||||
};
|
||||
/** This section contains all the level data. It can be found in 2 distinct forms, depending on Project current settings: - If \"*Separate level files*\" is **disabled** (default): full level data is *embedded* inside the main Project JSON file, - If \"*Separate level files*\" is **enabled**: level data is stored in *separate* standalone `.ldtkl` files (one per level). In this case, the main Project JSON file will still contain most level data, except heavy sections, like the `layerInstances` array (which will be null). The `externalRelPath` string points to the `ldtkl` file. A `ldtkl` file is just a JSON file containing exactly what is described below. */
|
||||
type LDtkLevel = {
|
||||
/** Background color of the level (same as `bgColor`, except the default value is automatically used here if its value is `null`) */
|
||||
__bgColor: string;
|
||||
/** Position informations of the background image, if there is one. */
|
||||
__bgPos: LDtkLevelBgPosInfos | null;
|
||||
/** An array listing all other levels touching this one on the world map.<br/> Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, this array is always empty. */
|
||||
__neighbours: LDtkNeighbourLevel[];
|
||||
/** The \"guessed\" color for this level in the editor, decided using either the background color or an existing custom field. */
|
||||
__smartColor: string;
|
||||
/** Background color of the level. If `null`, the project `defaultLevelBgColor` should be used. */
|
||||
bgColor: string | null;
|
||||
/** Background image Y pivot (0-1) */
|
||||
bgPivotY: number;
|
||||
/** Background image X pivot (0-1) */
|
||||
bgPivotX: number;
|
||||
/** An enum defining the way the background image (if any) is positioned on the level. See `__bgPos` for resulting position info. Possible values: <`null`>, `Unscaled`, `Contain`, `Cover`, `CoverDirty` */
|
||||
bgPos: 'Unscaled' | 'Contain' | 'Cover' | 'CoverDirty' | null;
|
||||
/** The *optional* relative path to the level background image. */
|
||||
bgRelPath: string | null;
|
||||
/** This value is not null if the project option \"*Save levels separately*\" is enabled. In this case, this **relative** path points to the level Json file. */
|
||||
externalRelPath: string | null;
|
||||
/** An array containing this level custom field values. */
|
||||
fieldInstances: LDtkFieldInstance[];
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** Unique instance identifier */
|
||||
iid: string;
|
||||
/** An array containing all Layer instances. **IMPORTANT**: if the project option \"*Save levels separately*\" is enabled, this field will be `null`.<br/> This array is **sorted in display order**: the 1st layer is the top-most and the last is behind. */
|
||||
layerInstances: LDtkLayerInstance[] | null;
|
||||
/** Height of the level in pixels */
|
||||
pxHei: integer;
|
||||
/** Width of the level in pixels */
|
||||
pxWid: integer;
|
||||
/** Unique Int identifier */
|
||||
uid: integer;
|
||||
/** If TRUE, the level identifier will always automatically use the naming pattern as defined in `Project.levelNamePattern`. Becomes FALSE if the identifier is manually modified by user. */
|
||||
useAutoIdentifier: boolean;
|
||||
/** Index that represents the \"depth\" of the level in the world. Default is 0, greater means \"above\", lower means \"below\".<br/> This value is mostly used for display only and is intended to make stacking of levels easier to manage. */
|
||||
worldDepth: integer;
|
||||
/** World X coordinate in pixels.<br/> Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the value is always -1 here. */
|
||||
worldX: integer;
|
||||
/** World Y coordinate in pixels.<br/> Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the value is always -1 here. */
|
||||
worldY: integer;
|
||||
};
|
||||
/** Level background image position info */
|
||||
type LDtkLevelBgPosInfos = {
|
||||
/** An array of 4 float values describing the cropped sub-rectangle of the displayed background image. This cropping happens when original is larger than the level bounds. Array format: `[ cropX, cropY, cropWidth, cropHeight ]` */
|
||||
cropRect: number[];
|
||||
/** An array containing the `[scaleX,scaleY]` values of the **cropped** background image, depending on `bgPos` option. */
|
||||
scale: number[];
|
||||
/** An array containing the `[x,y]` pixel coordinates of the top-left corner of the **cropped** background image, depending on `bgPos` option. */
|
||||
topLeftPx: integer[];
|
||||
};
|
||||
/** Nearby level info */
|
||||
type LDtkNeighbourLevel = {
|
||||
/** A single lowercase character tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast). */
|
||||
dir: string;
|
||||
/** Neighbour Instance Identifier */
|
||||
levelIid: string;
|
||||
/** **WARNING**: this deprecated value will be *removed* completely on version 1.2.0+ Replaced by: `levelIid` */
|
||||
levelUid: integer;
|
||||
};
|
||||
/** This structure represents a single tile from a given Tileset. */
|
||||
type LDtkTile = {
|
||||
/** Internal data used by the editor.<br/> For auto-layer tiles: `[ruleId, coordId]`.<br/> For tile-layer tiles: `[coordId]`. */
|
||||
d: integer[];
|
||||
/** \"Flip bits\", a 2-bits integer to represent the mirror transformations of the tile.<br/> - Bit 0 = X flip<br/> - Bit 1 = Y flip<br/> Examples: f=0 (no flip), f=1 (X flip only), f=2 (Y flip only), f=3 (both flips) */
|
||||
f: integer;
|
||||
/** Pixel coordinates of the tile in the **layer** (`[x,y]` format). Don't forget optional layer offsets, if they exist! */
|
||||
px: integer[];
|
||||
/** Pixel coordinates of the tile in the **tileset** (`[x,y]` format) */
|
||||
src: integer[];
|
||||
/** The *Tile ID* in the corresponding tileset. */
|
||||
t: integer;
|
||||
};
|
||||
/** The `Tileset` definition is the most important part among project definitions. It contains some extra informations about each integrated tileset. If you only had to parse one definition section, that would be the one. */
|
||||
export type LDtkTilesetDef = {
|
||||
/** Grid-based height */
|
||||
__cHei: integer;
|
||||
/** Grid-based width */
|
||||
__cWid: integer;
|
||||
/** The following data is used internally for various optimizations. It's always synced with source image changes. */
|
||||
cachedPixelData: object | null;
|
||||
/** An array of custom tile metadata */
|
||||
customData: LDtkTileCustomMetadata[];
|
||||
/** If this value is set, then it means that this atlas uses an internal LDtk atlas image instead of a loaded one. Possible values: <`null`>, `LdtkIcons` */
|
||||
embedAtlas: 'LdtkIcons' | null;
|
||||
/** Tileset tags using Enum values specified by `tagsSourceEnumId`. This array contains 1 element per Enum value, which contains an array of all Tile IDs that are tagged with it. */
|
||||
enumTags: LDtkEnumTagValue[];
|
||||
/** User defined unique identifier */
|
||||
identifier: string;
|
||||
/** Distance in pixels from image borders */
|
||||
padding: integer;
|
||||
/** Image height in pixels */
|
||||
pxHei: integer;
|
||||
/** Image width in pixels */
|
||||
pxWid: integer;
|
||||
/** Path to the source file, relative to the current project JSON file<br/> It can be null if no image was provided, or when using an embed atlas. */
|
||||
relPath: string | null;
|
||||
/** Array of group of tiles selections, only meant to be used in the editor */
|
||||
savedSelections: object[];
|
||||
/** Space in pixels between all tiles */
|
||||
spacing: integer;
|
||||
/** An array of user-defined tags to organize the Tilesets */
|
||||
tags: string[];
|
||||
/** Optional Enum definition UID used for this tileset meta-data */
|
||||
tagsSourceEnumUid: integer | null;
|
||||
/** */
|
||||
tileGridSize: integer;
|
||||
/** Unique Intidentifier */
|
||||
uid: integer;
|
||||
};
|
||||
/** In a tileset definition, user defined meta-data of a tile. */
|
||||
type LDtkTileCustomMetadata = {
|
||||
/** */
|
||||
data: string;
|
||||
/** */
|
||||
tileId: integer;
|
||||
};
|
||||
/** This object represents a custom sub rectangle in a Tileset image. */
|
||||
type LDtkTilesetRect = {
|
||||
/** Height in pixels */
|
||||
h: integer;
|
||||
/** UID of the tileset */
|
||||
tilesetUid: integer;
|
||||
/** Width in pixels */
|
||||
w: integer;
|
||||
/** X pixels coordinate of the top-left corner in the Tileset image */
|
||||
x: integer;
|
||||
/** Y pixels coordinate of the top-left corner in the Tileset image */
|
||||
y: integer;
|
||||
};
|
||||
type LDtkWorld = {};
|
||||
export {};
|
||||
//# sourceMappingURL=LDtkFormat.d.ts.map
|
File diff suppressed because one or more lines are too long
@@ -1,16 +0,0 @@
|
||||
import { EditableTileMap } from '../../model/TileMapModel';
|
||||
import { LDtkTileMap } from './LDtkFormat';
|
||||
export declare namespace LDtkTileMapLoader {
|
||||
/**
|
||||
* Create a {@link EditableTileMap} from the LDtk JSON.
|
||||
*
|
||||
* @param ldtkTileMap A tile map exported from LDtk.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @returns A {@link EditableTileMap}
|
||||
*/
|
||||
function load(
|
||||
ldtkTileMap: LDtkTileMap,
|
||||
levelIndex: number
|
||||
): EditableTileMap | null;
|
||||
}
|
||||
//# sourceMappingURL=LDtkTileMapLoader.d.ts.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"LDtkTileMapLoader.d.ts","sourceRoot":"","sources":["../../../src/load/ldtk/LDtkTileMapLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,yBAAiB,iBAAiB,CAAC;IACjC;;;;;;OAMG;IACH,SAAgB,IAAI,CAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,MAAM,GACjB,eAAe,GAAG,IAAI,CA6IxB;CACF"}
|
@@ -1,5 +0,0 @@
|
||||
export declare function getLDtkTileId(
|
||||
tileSetId: number,
|
||||
tileId: number
|
||||
): number;
|
||||
//# sourceMappingURL=LDtkTileMapLoaderHelper.d.ts.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"LDtkTileMapLoaderHelper.d.ts","sourceRoot":"","sources":["../../../src/load/ldtk/LDtkTileMapLoaderHelper.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQvE"}
|
File diff suppressed because one or more lines are too long
@@ -1,16 +0,0 @@
|
||||
import { EditableTileMap } from '../../model/TileMapModel';
|
||||
import { TiledTileMap } from './TiledFormat';
|
||||
/**
|
||||
* It creates a {@link EditableTileMap} from a Tiled JSON.
|
||||
*/
|
||||
export declare namespace TiledTileMapLoader {
|
||||
/**
|
||||
* Create a {@link EditableTileMap} from the Tiled JSON.
|
||||
*
|
||||
* @param tiledTileMap A tile map exported from Tiled.
|
||||
* @param pako The zlib library.
|
||||
* @returns A {@link EditableTileMap}
|
||||
*/
|
||||
function load(tiledTileMap: TiledTileMap, pako: any): EditableTileMap | null;
|
||||
}
|
||||
//# sourceMappingURL=TiledTileMapLoader.d.ts.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"TiledTileMapLoader.d.ts","sourceRoot":"","sources":["../../../src/load/tiled/TiledTileMapLoader.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAO7C;;GAEG;AACH,yBAAiB,kBAAkB,CAAC;IAClC;;;;;;OAMG;IACH,SAAgB,IAAI,CAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,GAAG,GACR,eAAe,GAAG,IAAI,CA0KxB;CACF"}
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"TiledTileMapLoader.spec.d.ts","sourceRoot":"","sources":["../../../src/load/tiled/TiledTileMapLoader.spec.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"TiledTileMapLoaderHelper.d.ts","sourceRoot":"","sources":["../../../src/load/tiled/TiledTileMapLoaderHelper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,SAAU,GAAG,cAAc,UAAU,aAgDtE,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,kBACvB,OAAO,KACrB,QAmBF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAEpB"}
|
@@ -1,5 +1,5 @@
|
||||
export declare type integer = number;
|
||||
export declare type float = number;
|
||||
export type FloatPoint = [float, float];
|
||||
export type PolygonVertices = FloatPoint[];
|
||||
export declare type FloatPoint = [float, float];
|
||||
export declare type PolygonVertices = FloatPoint[];
|
||||
//# sourceMappingURL=CommonTypes.d.ts.map
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"CommonTypes.d.ts","sourceRoot":"","sources":["../../src/model/CommonTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,MAAM,OAAO,GAAG,MAAM,CAAC;AACrC,MAAM,CAAC,OAAO,MAAM,KAAK,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,UAAU,EAAE,CAAC"}
|
||||
{"version":3,"file":"CommonTypes.d.ts","sourceRoot":"","sources":["../../src/model/CommonTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,MAAM,OAAO,GAAG,MAAM,CAAC;AACrC,MAAM,CAAC,OAAO,MAAM,KAAK,GAAG,MAAM,CAAC;AACnC,oBAAY,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAExC,oBAAY,eAAe,GAAG,UAAU,EAAE,CAAC"}
|
45
Extensions/TileMap/helper/dts/model/GID.d.ts
vendored
45
Extensions/TileMap/helper/dts/model/GID.d.ts
vendored
@@ -1,45 +0,0 @@
|
||||
import { integer } from './CommonTypes';
|
||||
export declare const FLIPPED_HORIZONTALLY_FLAG = 2147483648;
|
||||
export declare const FLIPPED_VERTICALLY_FLAG = 1073741824;
|
||||
export declare const FLIPPED_DIAGONALLY_FLAG = 536870912;
|
||||
/**
|
||||
* Tile identifiers making to access flipping flags.
|
||||
*/
|
||||
export declare namespace FlippingHelper {
|
||||
const tileIdMask: number;
|
||||
function getTileId(tileId: integer): integer;
|
||||
function setFlippedHorizontally(
|
||||
tileId: integer,
|
||||
flippedHorizontally: boolean
|
||||
): integer;
|
||||
function setFlippedVertically(
|
||||
tileId: integer,
|
||||
flippedVertically: boolean
|
||||
): integer;
|
||||
function setFlippedDiagonally(
|
||||
tileId: integer,
|
||||
flippedDiagonally: boolean
|
||||
): integer;
|
||||
function isFlippedHorizontally(tileId: integer): boolean;
|
||||
function isFlippedVertically(tileId: integer): boolean;
|
||||
function isFlippedDiagonally(tileId: integer): boolean;
|
||||
}
|
||||
/**
|
||||
* Return the texture to use for the tile with the specified uid, which can contains
|
||||
* information about rotation in bits 32, 31 and 30
|
||||
* (see https://doc.mapeditor.org/en/stable/reference/tmx-map-format/).
|
||||
*
|
||||
* @param flippedHorizontally true if the tile is flipped horizontally.
|
||||
* @param flippedVertically true if the tile is flipped vertically.
|
||||
* @param flippedDiagonally true if the tile is flipped diagonally.
|
||||
* @returns the rotation "D8" number used by Pixi.
|
||||
* @see https://pixijs.io/examples/#/textures/texture-rotate.js
|
||||
*/
|
||||
export declare function getPixiRotate(tileGID: integer): number;
|
||||
export declare function getTileGID(
|
||||
tileId: integer,
|
||||
flippedHorizontally: boolean,
|
||||
flippedVertically: boolean,
|
||||
flippedDiagonally: boolean
|
||||
): integer;
|
||||
//# sourceMappingURL=GID.d.ts.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"GID.d.ts","sourceRoot":"","sources":["../../src/model/GID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,yBAAyB,aAAa,CAAC;AACpD,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAClD,eAAO,MAAM,uBAAuB,YAAa,CAAC;AAElD;;GAEG;AACH,yBAAiB,cAAc,CAAC;IACvB,MAAM,UAAU,QAItB,CAAC;IAEF,SAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAElD;IAED,SAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,mBAAmB,EAAE,OAAO,GAC3B,OAAO,CAMT;IAED,SAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAMT;IAED,SAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,EACf,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAMT;IAED,SAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE9D;IAED,SAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE5D;IAED,SAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE5D;CACF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,UA0B7C;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,OAAO,EACf,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAYT"}
|
@@ -2,13 +2,12 @@ import { PolygonVertices, integer, float } from './CommonTypes';
|
||||
/**
|
||||
* A tile map model.
|
||||
*
|
||||
* Tile map files are parsed into this model by {@link TiledTileMapLoader} or {@link LDtkTileMapLoader}.
|
||||
* Tile map files are parsed into this model by {@link TiledTileMapLoader}.
|
||||
* This model is used for rending ({@link TileMapRuntimeObjectPixiRenderer})
|
||||
* and hitboxes handling ({@link TransformedCollisionTileMap}).
|
||||
* This allows to support new file format with only a new parser.
|
||||
*/
|
||||
export declare class EditableTileMap {
|
||||
private _backgroundResourceName?;
|
||||
private _tileSet;
|
||||
private _layers;
|
||||
/**
|
||||
@@ -84,10 +83,6 @@ export declare class EditableTileMap {
|
||||
* @returns The new layer.
|
||||
*/
|
||||
addObjectLayer(id: integer): EditableObjectLayer;
|
||||
/**
|
||||
* @returns The resource name of the background
|
||||
*/
|
||||
getBackgroundResourceName(): string;
|
||||
/**
|
||||
* @returns All the layers of the tile map.
|
||||
*/
|
||||
@@ -104,10 +99,6 @@ export declare class EditableTileMap {
|
||||
* @returns true when the point is inside a tile with a given tag.
|
||||
*/
|
||||
pointIsInsideTile(x: float, y: float, tag: string): boolean;
|
||||
/**
|
||||
* @param resourceName The name of the resource
|
||||
*/
|
||||
setBackgroundResourceName(resourceName: string): void;
|
||||
}
|
||||
/**
|
||||
* A tile map layer.
|
||||
@@ -192,24 +183,15 @@ export declare class TileObject {
|
||||
*/
|
||||
export declare class EditableTileMapLayer extends AbstractEditableLayer {
|
||||
private readonly _tiles;
|
||||
private _alpha;
|
||||
/**
|
||||
* @param tileMap The layer tile map.
|
||||
* @param id The layer identifier.
|
||||
*/
|
||||
constructor(tileMap: EditableTileMap, id: integer);
|
||||
/**
|
||||
* The opacity (between 0-1) of the layer
|
||||
*/
|
||||
getAlpha(): float;
|
||||
/**
|
||||
* @param alpha The opacity between 0-1
|
||||
*/
|
||||
setAlpha(alpha: float): void;
|
||||
/**
|
||||
* @param x The layer column.
|
||||
* @param y The layer row.
|
||||
* @param tileId The tile.
|
||||
* @param tileId The tile identifier in the tile set.
|
||||
*/
|
||||
setTile(x: integer, y: integer, tileId: integer): void;
|
||||
/**
|
||||
@@ -268,15 +250,9 @@ export declare class EditableTileMapLayer extends AbstractEditableLayer {
|
||||
/**
|
||||
* @param x The layer column.
|
||||
* @param y The layer row.
|
||||
* @returns The tile's GID (id + flipping bits).
|
||||
* @returns The tile identifier from the tile set.
|
||||
*/
|
||||
getTileGID(x: integer, y: integer): integer | undefined;
|
||||
/**
|
||||
* @param x The layer column.
|
||||
* @param y The layer row.
|
||||
* @returns The tile's id.
|
||||
*/
|
||||
getTileId(x: integer, y: integer): integer | undefined;
|
||||
get(x: integer, y: integer): integer | undefined;
|
||||
/**
|
||||
* The number of tile columns in the layer.
|
||||
*/
|
||||
@@ -304,28 +280,23 @@ export declare class TileDefinition {
|
||||
*/
|
||||
private readonly taggedHitBoxes;
|
||||
private readonly animationLength;
|
||||
/**
|
||||
* A tile can be a composition of several tiles.
|
||||
*/
|
||||
private stackedTiles;
|
||||
private stackTileId?;
|
||||
/**
|
||||
* @param animationLength The number of frame in the tile animation.
|
||||
*/
|
||||
constructor(animationLength?: integer);
|
||||
constructor(animationLength: integer);
|
||||
/**
|
||||
* Add a polygon for the collision layer
|
||||
* @param tag The tag to allow collision layer filtering.
|
||||
* @param polygon The polygon to use for collisions.
|
||||
*/
|
||||
addHitBox(tag: string, polygon: PolygonVertices): void;
|
||||
add(tag: string, polygon: PolygonVertices): void;
|
||||
/**
|
||||
* This property is used by {@link TransformedCollisionTileMap}
|
||||
* to make collision classes.
|
||||
* @param tag The tag to allow collision layer filtering.
|
||||
* @returns true if this tile contains any polygon with the given tag.
|
||||
*/
|
||||
hasTaggedHitBox(tag: string): boolean;
|
||||
hasTag(tag: string): boolean;
|
||||
/**
|
||||
* The hitboxes positioning is done by {@link TransformedCollisionTileMap}.
|
||||
* @param tag The tag to allow collision layer filtering.
|
||||
@@ -339,23 +310,6 @@ export declare class TileDefinition {
|
||||
* @returns The number of frame in the tile animation.
|
||||
*/
|
||||
getAnimationLength(): integer;
|
||||
/**
|
||||
* @returns The tile representing the stack of tiles.
|
||||
*/
|
||||
getStackTileId(): integer;
|
||||
/**
|
||||
* @returns All the tiles composed in the stack.
|
||||
*/
|
||||
getStackedTiles(): integer[];
|
||||
/**
|
||||
* @returns `true` if the defintion is a stack of tiles.
|
||||
*/
|
||||
hasStackedTiles(): boolean;
|
||||
/**
|
||||
* @param stackTileId The `tileId` representing the stack.
|
||||
* @param tiles All the tiles of stack.
|
||||
*/
|
||||
setStackedTiles(stackTileId: integer, ...tiles: integer[]): void;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=TileMapModel.d.ts.map
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"TileMapModel.d.ts","sourceRoot":"","sources":["../../src/model/TileMapModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGhE;;;;;;;GAOG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,uBAAuB,CAAC,CAAS;IACzC,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,OAAO,CAA+B;IAC9C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IACrC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAE/B;;;;;;OAMG;gBAED,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EAGb,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC;IAUvC;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS;IAI9D;;OAEG;IACH,kBAAkB,IAAI,QAAQ,CAAC,cAAc,CAAC;IAI9C;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,oBAAoB;IAM/C;;;OAGG;IACH,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,mBAAmB;IAMhD;;OAEG;IACH,yBAAyB,IAAI,MAAM;IAInC;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,qBAAqB,CAAC;IAI5C;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAoB3D;;OAEG;IACH,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CAGtD;AAED;;GAEG;AACH,uBAAe,qBAAqB;IAClC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,OAAO,CAAiB;IAEhC;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IAKjD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC;;OAEG;IACH,SAAS,IAAI,OAAO;CAGrB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC5D,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;IAE/B;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IAKjD,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;CAG9B;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAU;IACxB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC;IAElB;;;;OAIG;gBACS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO;IAM/C;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB,sBAAsB,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI;IAO1D,oBAAoB,CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI;IAOtD,oBAAoB,CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI;IAOtD;;OAEG;IACH,qBAAqB,IAAI,OAAO;IAIhC;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,mBAAmB,IAAI,OAAO;CAG/B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,qBAAqB;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,MAAM,CAAQ;IAEtB;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IAUjD;;OAEG;IACH,QAAQ,IAAI,KAAK;IAIjB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK;IAIrB;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAUtD;;;OAGG;IACH,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,IAAI;IAKxC;;;;OAIG;IACH,sBAAsB,CACpB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,mBAAmB,EAAE,OAAO,GAC3B,IAAI;IAWP;;;;OAIG;IACH,oBAAoB,CAClB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,iBAAiB,EAAE,OAAO,GACzB,IAAI;IAWP;;;;OAIG;IACH,oBAAoB,CAClB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,iBAAiB,EAAE,OAAO,GACzB,IAAI;IAWP;;;;OAIG;IACH,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAItD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAIpD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAIpD;;;;OAIG;IACH,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IASvD;;;;OAIG;IACH,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAUtD;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,SAAS,IAAI,OAAO;CAGrB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG3B;IACJ,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;OAEG;IACH,OAAO,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,WAAW,CAAC,CAAU;IAE9B;;OAEG;gBACS,eAAe,CAAC,EAAE,OAAO;IAMrC;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAStD;;;;;OAKG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIrC;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,SAAS;IAOvD;;;;;OAKG;IACH,kBAAkB,IAAI,OAAO;IAI7B;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,eAAe,IAAI,OAAO,EAAE;IAI5B;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;;OAGG;IACH,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI;CAIjE"}
|
||||
{"version":3,"file":"TileMapModel.d.ts","sourceRoot":"","sources":["../../src/model/TileMapModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,OAAO,CAA+B;IAC9C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;IACpC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IACrC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAE/B;;;;;;OAMG;gBAED,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,OAAO,EAGb,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC;IAUvC;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS;IAI9D;;OAEG;IACH,kBAAkB,IAAI,QAAQ,CAAC,cAAc,CAAC;IAI9C;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,OAAO,GAAG,oBAAoB;IAM/C;;;OAGG;IACH,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,mBAAmB;IAMhD;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,qBAAqB,CAAC;IAI5C;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;CAmB5D;AAED;;GAEG;AACH,uBAAe,qBAAqB;IAClC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,OAAO,CAAiB;IAEhC;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IAKjD,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC;;OAEG;IACH,SAAS,IAAI,OAAO;CAGrB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC5D,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;IAE/B;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IAKjD,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;CAG9B;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAU;IACxB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC;IAElB;;;;OAIG;gBACS,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO;IAM/C;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB,sBAAsB,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI;IAO1D,oBAAoB,CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI;IAOtD,oBAAoB,CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI;IAOtD;;OAEG;IACH,qBAAqB,IAAI,OAAO;IAIhC;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,mBAAmB,IAAI,OAAO;CAG/B;AAiED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,qBAAqB;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAE3C;;;OAGG;gBACS,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO;IASjD;;;;OAIG;IACH,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAUtD;;;OAGG;IACH,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,IAAI;IAKxC;;;;OAIG;IACH,sBAAsB,CACpB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,mBAAmB,EAAE,OAAO,GAC3B,IAAI;IAWP;;;;OAIG;IACH,oBAAoB,CAClB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,iBAAiB,EAAE,OAAO,GACzB,IAAI;IAWP;;;;OAIG;IACH,oBAAoB,CAClB,CAAC,EAAE,OAAO,EACV,CAAC,EAAE,OAAO,EACV,iBAAiB,EAAE,OAAO,GACzB,IAAI;IAWP;;;;OAIG;IACH,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAItD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAIpD;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO;IAIpD;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;IAUhD;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,SAAS,IAAI,OAAO;CAGrB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG3B;IACJ,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;OAEG;gBACS,eAAe,EAAE,OAAO;IAKpC;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAShD;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,SAAS;IAOvD;;;;;OAKG;IACH,kBAAkB,IAAI,OAAO;CAG9B"}
|
@@ -1,7 +1,7 @@
|
||||
import { TiledMap } from '../tiled/TiledFormat';
|
||||
import { EditableTileMap } from '../model/TileMapModel';
|
||||
import { TileTextureCache } from './TileTextureCache';
|
||||
import PIXI = GlobalPIXIModule.PIXI;
|
||||
import { TileMap } from '../types';
|
||||
/**
|
||||
* A holder to share tile maps across the 2 extension objects.
|
||||
*
|
||||
@@ -20,50 +20,41 @@ export declare class TileMapManager {
|
||||
*/
|
||||
static getManager(instanceHolder: Object): TileMapManager;
|
||||
/**
|
||||
* @param data JSON data.
|
||||
* @returns The data enclosed with its detected kind.
|
||||
*/
|
||||
static identify(data: any): TileMap | null;
|
||||
/**
|
||||
* @param loadTileMap The method that loads the Tiled JSON file in memory.
|
||||
* @param loadTiledMap The method that loads the Tiled JSON file in memory.
|
||||
* @param tileMapJsonResourceName The resource name of the tile map.
|
||||
* @param tileSetJsonResourceName The resource name of the tile set.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @param pako The zlib library.
|
||||
* @param callback A function called when the tile map is parsed.
|
||||
*/
|
||||
getOrLoadTileMap(
|
||||
loadTileMap: (
|
||||
loadTiledMap: (
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
callback: (tileMap: TileMap | null) => void
|
||||
callback: (tiledMap: TiledMap | null) => void
|
||||
) => void,
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
levelIndex: number,
|
||||
pako: any,
|
||||
callback: (tileMap: EditableTileMap | null) => void
|
||||
): void;
|
||||
/**
|
||||
* @param loadTileMap The method that loads the Tiled JSON file in memory.
|
||||
* @param loadTiledMap The method that loads the Tiled JSON file in memory.
|
||||
* @param getTexture The method that loads the atlas image file in memory.
|
||||
* @param atlasImageResourceName The resource name of the atlas image.
|
||||
* @param tileMapJsonResourceName The resource name of the tile map.
|
||||
* @param tileSetJsonResourceName The resource name of the tile set.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @param callback A function called when the tiles textures are split.
|
||||
*/
|
||||
getOrLoadTextureCache(
|
||||
loadTileMap: (
|
||||
loadTiledMap: (
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
callback: (tileMap: TileMap | null) => void
|
||||
callback: (tiledMap: TiledMap | null) => void
|
||||
) => void,
|
||||
getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>,
|
||||
atlasImageResourceName: string,
|
||||
tileMapJsonResourceName: string,
|
||||
tileSetJsonResourceName: string,
|
||||
levelIndex: number,
|
||||
callback: (textureCache: TileTextureCache | null) => void
|
||||
): void;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"TileMapManager.d.ts","sourceRoot":"","sources":["../../src/render/TileMapManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,mBAAmB,CAAkC;;IAO7D;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc;IAWzD;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,GAAG,IAAI;IAyB1C;;;;;;;OAOG;IACH,gBAAgB,CACd,WAAW,EAAE,CACX,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,KACxC,IAAI,EACT,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,GAClD,IAAI;IAiCP;;;;;;;;OAQG;IACH,qBAAqB,CACnB,WAAW,EAAE,CACX,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,KACxC,IAAI,EACT,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EACpE,sBAAsB,EAAE,MAAM,EAC9B,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,GACxD,IAAI;CAuCR"}
|
||||
{"version":3,"file":"TileMapManager.d.ts","sourceRoot":"","sources":["../../src/render/TileMapManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,mBAAmB,CAAkC;;IAO7D;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,cAAc;IAWzD;;;;;;OAMG;IACH,gBAAgB,CACd,YAAY,EAAE,CACZ,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,KAC1C,IAAI,EACT,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,GAClD,IAAI;IAwBP;;;;;;;OAOG;IACH,qBAAqB,CACnB,YAAY,EAAE,CACZ,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,KAC1C,IAAI,EACT,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,EACpE,sBAAsB,EAAE,MAAM,EAC9B,uBAAuB,EAAE,MAAM,EAC/B,uBAAuB,EAAE,MAAM,EAC/B,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,GACxD,IAAI;CAoCR"}
|
@@ -1,28 +1,26 @@
|
||||
import { integer, float } from '../model/CommonTypes';
|
||||
import { TiledMap } from '../tiled/TiledFormat';
|
||||
import { EditableTileMap } from '../model/TileMapModel';
|
||||
import { TileMap } from '../types';
|
||||
import { TileTextureCache } from './TileTextureCache';
|
||||
import PIXI = GlobalPIXIModule.PIXI;
|
||||
export declare namespace PixiTileMapHelper {
|
||||
export declare class PixiTileMapHelper {
|
||||
/**
|
||||
* Split an atlas image into Pixi textures.
|
||||
*
|
||||
* @param tiledMap A tile map exported from Tiled.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @param atlasTexture The texture containing the whole tile set.
|
||||
* @param getTexture A getter to load a texture. Used if atlasTexture is not specified.
|
||||
* @returns A textures cache.
|
||||
*/
|
||||
function parseAtlas(
|
||||
tileMap: TileMap,
|
||||
levelIndex: number,
|
||||
static parseAtlas(
|
||||
tiledMap: TiledMap,
|
||||
atlasTexture: PIXI.BaseTexture<PIXI.Resource> | null,
|
||||
getTexture: (textureName: string) => PIXI.BaseTexture<PIXI.Resource>
|
||||
): TileTextureCache | null;
|
||||
/**
|
||||
* Re-renders the tile map whenever its rendering settings have been changed
|
||||
*
|
||||
* @param untypedPixiTileMap the tile map renderer
|
||||
* @param pixiTileMap the tile map renderer
|
||||
* @param tileMap the tile map model
|
||||
* @param textureCache the tile set textures
|
||||
* @param displayMode What to display:
|
||||
@@ -32,7 +30,7 @@ export declare namespace PixiTileMapHelper {
|
||||
* @param layerIndex If `displayMode` is set to `index`, the layer index to be
|
||||
* displayed.
|
||||
*/
|
||||
function updatePixiTileMap(
|
||||
static updatePixiTileMap(
|
||||
untypedPixiTileMap: any,
|
||||
tileMap: EditableTileMap,
|
||||
textureCache: TileTextureCache,
|
||||
@@ -42,7 +40,7 @@ export declare namespace PixiTileMapHelper {
|
||||
/**
|
||||
* Re-renders the collision mask
|
||||
*/
|
||||
function updatePixiCollisionMask(
|
||||
static updatePixiCollisionMask(
|
||||
pixiGraphics: PIXI.Graphics,
|
||||
tileMap: EditableTileMap,
|
||||
typeFilter: string,
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"TileMapPixiHelper.d.ts","sourceRoot":"","sources":["../../src/render/TileMapPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEpC,yBAAiB,iBAAiB,CAAC;IACjC;;;;;;;;OAQG;IACH,SAAgB,UAAU,CACxB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EACpD,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GACnE,gBAAgB,GAAG,IAAI,CAuBzB;IAED;;;;;;;;;;;;OAYG;IACH,SAAgB,iBAAiB,CAC/B,kBAAkB,EAAE,GAAG,EACvB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,EACxC,UAAU,EAAE,MAAM,GACjB,IAAI,CA0GN;IAED;;OAEG;IACH,SAAgB,uBAAuB,CACrC,YAAY,EAAE,IAAI,CAAC,QAAQ,EAC3B,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,KAAK,EACrB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,KAAK,GACjB,IAAI,CAgEN;CACF"}
|
||||
{"version":3,"file":"TileMapPixiHelper.d.ts","sourceRoot":"","sources":["../../src/render/TileMapPixiHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAEL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAGpC,qBAAa,iBAAiB;IAC5B;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EACpD,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,GACnE,gBAAgB,GAAG,IAAI;IA6F1B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,iBAAiB,CACtB,kBAAkB,EAAE,GAAG,EACvB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,EACxC,UAAU,EAAE,MAAM,GACjB,IAAI;IAgFP;;OAEG;IACH,MAAM,CAAC,uBAAuB,CAC5B,YAAY,EAAE,IAAI,CAAC,QAAQ,EAC3B,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,KAAK,EACrB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,KAAK,GACjB,IAAI;CAiER"}
|
@@ -7,18 +7,44 @@ import PIXI = GlobalPIXIModule.PIXI;
|
||||
* and used by {@link PixiTileMapHelper.updatePixiTileMap}.
|
||||
*/
|
||||
export declare class TileTextureCache {
|
||||
private readonly _levelBackgroundTextures;
|
||||
private static readonly flippedHorizontallyFlag;
|
||||
private static readonly flippedVerticallyFlag;
|
||||
private static readonly flippedDiagonallyFlag;
|
||||
private readonly _textures;
|
||||
constructor();
|
||||
setTexture(tileId: integer, texture: PIXI.Texture): void;
|
||||
setTexture(
|
||||
tileId: integer,
|
||||
flippedHorizontally: boolean,
|
||||
flippedVertically: boolean,
|
||||
flippedDiagonally: boolean,
|
||||
texture: PIXI.Texture
|
||||
): void;
|
||||
/**
|
||||
* Return the texture to use for the tile with the specified id.
|
||||
*
|
||||
* @param tileId The tile identifier
|
||||
* @returns The texture for the given tile identifier.
|
||||
*/
|
||||
getTexture(tileId: integer): PIXI.Texture | undefined;
|
||||
getLevelBackgroundTexture(name: string): PIXI.Texture | undefined;
|
||||
setLevelBackgroundTexture(name: string, texture: PIXI.Texture): void;
|
||||
findTileTexture(tileId: integer): PIXI.Texture | undefined;
|
||||
/**
|
||||
* Return the texture to use for the tile with the specified uid, which can contains
|
||||
* information about rotation in bits 32, 31 and 30
|
||||
* (see https://doc.mapeditor.org/en/stable/reference/tmx-map-format/).
|
||||
*
|
||||
* @param flippedHorizontally true if the tile is flipped horizontally.
|
||||
* @param flippedVertically true if the tile is flipped vertically.
|
||||
* @param flippedDiagonally true if the tile is flipped diagonally.
|
||||
* @returns the rotation "D8" number used by Pixi.
|
||||
* @see https://pixijs.io/examples/#/textures/texture-rotate.js
|
||||
*/
|
||||
getPixiRotate(
|
||||
flippedHorizontally: boolean,
|
||||
flippedVertically: boolean,
|
||||
flippedDiagonally: boolean
|
||||
): number;
|
||||
/**
|
||||
* @return the Tiled tile global uniq identifier.
|
||||
*/
|
||||
private _getGlobalId;
|
||||
}
|
||||
//# sourceMappingURL=TileTextureCache.d.ts.map
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"TileTextureCache.d.ts","sourceRoot":"","sources":["../../src/render/TileTextureCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA4B;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;;IAOvD,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI;IAIxD;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS;IAIrD,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS;IAIjE,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI;CAGrE"}
|
||||
{"version":3,"file":"TileTextureCache.d.ts","sourceRoot":"","sources":["../../src/render/TileTextureCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC;AAEpC;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAc;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAc;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAc;IAE3D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;;IAMvD,UAAU,CACR,MAAM,EAAE,OAAO,EACf,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,IAAI,CAAC,OAAO,GACpB,IAAI;IAUP;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,SAAS;IAI1D;;;;;;;;;;OAUG;IACH,aAAa,CACX,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,OAAO,GACzB,MAAM;IAwBT;;OAEG;IACH,OAAO,CAAC,YAAY;CAkBrB"}
|
@@ -1,24 +0,0 @@
|
||||
import { TileTextureCache } from '../TileTextureCache';
|
||||
import { LDtkTileMap } from '../../load/ldtk/LDtkFormat';
|
||||
import PIXI = GlobalPIXIModule.PIXI;
|
||||
type Texture = PIXI.BaseTexture<PIXI.Resource>;
|
||||
type TextureLoader = (textureName: string) => PIXI.BaseTexture<PIXI.Resource>;
|
||||
export declare namespace LDtkPixiHelper {
|
||||
/**
|
||||
* Split an atlas image into Pixi textures.
|
||||
*
|
||||
* @param tileMap A tile map exported from LDtk.
|
||||
* @param levelIndex The level of the tile map to load from.
|
||||
* @param atlasTexture The texture containing the whole tile set.
|
||||
* @param getTexture A getter to load a texture.
|
||||
* @returns A textures cache.
|
||||
*/
|
||||
function parseAtlas(
|
||||
tileMap: LDtkTileMap,
|
||||
levelIndex: number,
|
||||
atlasTexture: Texture | null,
|
||||
getTexture: TextureLoader
|
||||
): TileTextureCache | null;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=LDtkPixiHelper.d.ts.map
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user