Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 46 additions & 7 deletions extensions/reviewed/RenderToSprite.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"author": "Arthur Pacaud (arthuro555)",
"category": "Advanced",
"dimension": "",
"extensionNamespace": "",
"gdevelopVersion": ">=5.5.222",
"fullName": "Sprite Snapshot",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNhbWVyYS1lbmhhbmNlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTksM0w3LjE3LDVINEEyLDIgMCAwLDAgMiw3VjE5QTIsMiAwIDAsMCA0LDIxSDIwQTIsMiAwIDAsMCAyMiwxOVY3QTIsMiAwIDAsMCAyMCw1SDE2LjgzTDE1LDNNMTIsMThBNSw1IDAgMCwxIDcsMTNBNSw1IDAgMCwxIDEyLDhBNSw1IDAgMCwxIDE3LDEzQTUsNSAwIDAsMSAxMiwxOE0xMiwxN0wxMy4yNSwxNC4yNUwxNiwxM0wxMy4yNSwxMS43NUwxMiw5TDEwLjc1LDExLjc1TDgsMTNMMTAuNzUsMTQuMjUiIC8+PC9zdmc+",
"name": "RenderToSprite",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/camera-enhance.svg",
"shortDescription": "Capture objects, layers, or scene areas as images into sprite textures.",
"version": "0.0.4",
"version": "0.0.5",
"description": [
"Allows rendering (creating an image) of objects, layers and the scene to display in a sprite. ",
"This allows to make optimizations by transforming the resulting image of a shape painter into a faster sprite, or to make viewports/cameras."
Expand All @@ -35,6 +36,8 @@
"PEzPAaWHgYgk5UwIPppsL6f2ugp2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"fullName": "",
Expand Down Expand Up @@ -68,8 +71,15 @@
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const source = eventsFunctionContext.getObjects(\"source\")[0].getRendererObject();",
"const renderTarget = eventsFunctionContext.getObjects(\"renderTarget\")[0].getRendererObject();",
"const sourceObject = eventsFunctionContext.getObjects(\"source\")[0];",
"const renderTargetObject = eventsFunctionContext.getObjects(\"renderTarget\")[0];",
"",
"if (!sourceObject || !renderTargetObject) {",
" return;",
"}",
"",
"const source = sourceObject.getRendererObject();",
"const renderTarget = renderTargetObject.getRendererObject();",
"",
"// Reset position so that it is not offscreen while rendering",
"const { x: originalX, y: originalY } = source.position;",
Expand Down Expand Up @@ -102,7 +112,7 @@
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
"eventsSheetExpanded": true
}
],
"parameters": [
Expand Down Expand Up @@ -135,6 +145,9 @@
"const width = runtimeScene.getLayer(\"\").getCameraWidth();",
"/** @type {gdjs.SpriteRuntimeObject} */",
"const obj = objects[0];",
"if (!obj) {",
" return;",
"}",
"/** @type {PIXI.Sprite} */",
"const renderTarget = obj.getRendererObject();",
"",
Expand Down Expand Up @@ -178,7 +191,7 @@
],
"parameterObjects": "renderTarget",
"useStrict": true,
"eventsSheetExpanded": false
"eventsSheetExpanded": true
}
],
"parameters": [
Expand Down Expand Up @@ -212,6 +225,9 @@
"const width = runtimeScene.getLayer(\"\").getCameraWidth();",
"/** @type {gdjs.SpriteRuntimeObject} */",
"const obj = objects[0];",
"if (!obj) {",
" return;",
"}",
"/** @type {PIXI.Sprite} */",
"const renderTarget = obj.getRendererObject();",
"",
Expand Down Expand Up @@ -285,6 +301,9 @@
"const height = eventsFunctionContext.getArgument(\"areaHeight\");",
"/** @type {gdjs.SpriteRuntimeObject} */",
"const obj = objects[0];",
"if (!obj) {",
" return;",
"}",
"/** @type {PIXI.Sprite} */",
"const renderTarget = obj.getRendererObject();",
"",
Expand Down Expand Up @@ -366,6 +385,26 @@
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "onFirstSceneLoaded"
},
{
"functionName": "RenderObject"
},
{
"functionName": "RenderLayer"
},
{
"functionName": "RenderScene"
},
{
"functionName": "RenderSceneArea"
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}
}
Loading