diff --git a/extensions/community/SpriteStacking.json b/extensions/community/SpriteStacking.json new file mode 100644 index 000000000..24212db5d --- /dev/null +++ b/extensions/community/SpriteStacking.json @@ -0,0 +1,602 @@ +{ + "author": "", + "category": "General", + "dimension": "2D", + "extensionNamespace": "", + "fullName": "Sprite Stacking", + "gdevelopVersion": "", + "helpPath": "https://eldarduil.itch.io/sprite-stacking-extension-for-gdevelop", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWxheWVycy10cmlwbGUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgMEwzIDdMNC42MyA4LjI3TDEyIDE0TDE5LjM2IDguMjdMMjEgN0wxMiAwTTE5LjM3IDEwLjczTDEyIDE2LjQ3TDQuNjIgMTAuNzRMMyAxMkwxMiAxOUwyMSAxMkwxOS4zNyAxMC43M00xOS4zNyAxNS43M0wxMiAyMS40N0w0LjYyIDE1Ljc0TDMgMTdMMTIgMjRMMjEgMTdMMTkuMzcgMTUuNzNaIiAvPjwvc3ZnPg==", + "name": "SpriteStacking", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/aa16433aab812cfb1e558bb1a8ccca399b07a10ea097f3ac81095141fe3f56a7_layers-triple.svg", + "shortDescription": "Create an object that uses multiple 2D image layers to create a 3D-looking visual.", + "version": "0.0.2", + "description": "Allows you to create pseudo-3D Sprite objects using the Sprite Stacking technique.", + "tags": [ + "sprite", + "sprite stacking", + "isometric", + "2.5D", + "3D", + "slice", + "stack", + "Top Down", + "Retro" + ], + "authorIds": [ + "m8kleQHonagHWsvILDhyJhgVhuF2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT" + }, + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 16, + "areaMaxY": 16, + "areaMaxZ": 0, + "areaMinX": -16, + "areaMinY": -16, + "areaMinZ": 0, + "defaultName": "", + "description": "An object that uses multiple 2D image layers to create a 3D-looking visual.", + "fullName": "Stacked Sprite", + "isUsingLegacyInstancesRenderer": false, + "name": "StackedSprite", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Slices", + "persistentUuid": "32683b5c-7fa4-45d4-9a11-09d138062472", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Slices", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "Slices2", + "points": [], + "originPoint": { + "name": "origine", + "x": 16, + "y": 16 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "PlaceholderForEditor", + "persistentUuid": "884e34ad-a3e3-4d6e-b85d-9895aa214133", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "PlaceholderForEditor", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": false, + "image": "PlaceholderForEditor2", + "points": [], + "originPoint": { + "name": "origine", + "x": 16, + "y": 16 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [] + } + ] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "PlaceholderForEditor" + }, + { + "objectName": "Slices" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "PlaceholderForEditor", + "persistentUuid": "0194a876-a3d1-4f72-a408-5391720c438c", + "width": 0, + "x": 16, + "y": 16, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 5.238203565570362, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Changing the local positions of the slices to always stay inline on y axis" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetXY" + }, + "parameters": [ + "Slices", + "=", + "Slices.ZOrder() * sin(ToRad(-Object.Angle()))", + "=", + "-Slices.ZOrder() * cos(ToRad(-Object.Angle()))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteStacking::StackedSprite", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Hiding the PlaceholderSprite" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "PlaceholderForEditor" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "For a brief moment, Creating and deleting the object to get the \"animationFrameCount\"" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "CastleLayers", + "Slices", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteStacking::StackedSprite::SetAnimationFrameCount" + }, + "parameters": [ + "Object", + "=", + "Slices.AnimationFrameCount()", + "" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Slices", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Stacking the sprite multiple times and offseting on Y axis 1 pixel" + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "AnimationFrameCount", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Slices", + "0", + "LayerNumber", + "" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::PauseAnimation" + }, + "parameters": [ + "Slices", + "Animation" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "Slices", + "=", + "LayerNumber" + ] + }, + { + "type": { + "value": "SetZOrder" + }, + "parameters": [ + "Slices", + "=", + "LayerNumber" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LayerNumber", + "+", + "1" + ] + } + ], + "variables": [ + { + "name": "LayerNumber", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteStacking::StackedSprite", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the animationFrameCount of the object.", + "fullName": "AnimationFrameCount", + "functionType": "ExpressionAndCondition", + "group": "StackedSprite configuration", + "name": "AnimationFrameCount", + "private": true, + "sentence": "the animationFrameCount", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "AnimationFrameCount" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteStacking::StackedSprite", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "AnimationFrameCount", + "group": "StackedSprite configuration", + "name": "SetAnimationFrameCount", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AnimationFrameCount", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteStacking::StackedSprite", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Changes the animation (by number) of Stacked Sprite.", + "fullName": "Change Animation of Stacked Sprite", + "functionType": "Action", + "name": "ChangeAnimation", + "sentence": "Change animation of Stacked Sprite _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Slices", + "Animation", + "=", + "AnimationByNumber" + ] + }, + { + "type": { + "value": "ChangeSprite" + }, + "parameters": [ + "Slices", + "=", + "Slices.ZOrder()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteStacking::StackedSprite", + "type": "object" + }, + { + "description": "Animation By Number", + "name": "AnimationByNumber", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "onCreated" + }, + { + "functionName": "doStepPostEvents" + }, + { + "folderName": "StackedSprite configuration", + "children": [ + { + "functionName": "AnimationFrameCount" + }, + { + "functionName": "SetAnimationFrameCount" + } + ] + }, + { + "functionName": "ChangeAnimation" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "AnimationFrameCount" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "AnimationFrameCount" + } + ] + } + } + ] +} \ No newline at end of file