diff --git a/Extensions/SkeletonObject/Askeletonruntimeobject-pixi-renderer.js b/Extensions/SkeletonObject/Askeletonruntimeobject-pixi-renderer.js new file mode 100644 index 0000000000..638d97317b --- /dev/null +++ b/Extensions/SkeletonObject/Askeletonruntimeobject-pixi-renderer.js @@ -0,0 +1,66 @@ + +/** +GDevelop - Skeleton Object Extension +Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) +This project is released under the MIT License. +*/ + +gdjs.SkeletonRuntimeObjectPixiRenderer = function() +{ + this.textures = {}; +}; +gdjs.SkeletonRuntimeObjectRenderer = gdjs.SkeletonRuntimeObjectPixiRenderer; + +gdjs.SkeletonRuntimeObjectPixiRenderer.prototype.getData = function(dataName){ + return PIXI.loader.resources[dataName].data; +}; + +gdjs.SkeletonRuntimeObjectPixiRenderer.prototype.loadDragonBones = function(runtimeScene, textureDataName, textureName){ + var textureData = this.getData(textureDataName); + var texture = runtimeScene.getGame().getImageManager().getPIXITexture(textureName); + + for(var i=0; i -1){ + this.children.splice(index, 1); + } +} + +gdjs.SkeletonTransform.prototype.setPos = function(x, y){ + if(this.x !== x || this.y !== y){ + this.x = x; + this.y = y; + this._updateMatrix = true; + } +} + +gdjs.SkeletonTransform.prototype.setRot = function(angle){ + angle *= Math.PI / 180.0; + if(this.rot !== angle){ + this.rot = angle; + this._updateMatrix = true; + } +} + +gdjs.SkeletonTransform.prototype.setScale = function(sx, sy){ + if(this.sx !== sx || this.sy !== sy){ + this.sx = sx; + this.sy = sy; + this._updateMatrix = true; + } +} + +gdjs.SkeletonTransform.prototype.move = function(x, y){ + this.x += x; + this.y += y; + this._updateMatrix = true; +} + +gdjs.SkeletonTransform.prototype.rotate = function(angle){ + this.rot += angle * Math.PI / 180.0; + this._updateMatrix = true; +} + +gdjs.SkeletonTransform.prototype.scale = function(sx, sy){ + this.sx *= sx; + this.sy *= sy; + this._updateMatrix = true; +} + +gdjs.SkeletonTransform.prototype.update = function(){ + this.updateTransform(); + + for(var i=0; i 0){ + this.rootArmature.loadDragonBones(skeletalData, 0, this.renderer.textures); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.setX = function(x){ + this.x = x; + this.rootArmature.setPos(x, this.y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setY = function(y){ + this.y = y; + this.rootArmature.setPos(this.x, y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAngle = function(angle){ + this.angle = angle; + this.rootArmature.setRot(angle); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleX = function(scaleX){ + this.scaleX = scaleX; + this.rootArmature.setScale(scaleX, this.scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleY = function(scaleY){ + this.scaleY = scaleY; + this.rootArmature.setScale(this.scaleX, scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setWidth = function(width){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.setHeight = function(height){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.getRendererObject = function(){ + return this.rootArmature.getRendererObject(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getHitBoxes = function(){ + return [this.rootArmature.getAABB()]; +}; + +gdjs.SkeletonRuntimeObject.prototype.update = function(runtimeScene){ + + var delta = this.getElapsedTime(runtimeScene) / 1000.0; + + // this.rootArmature.update(); + + if(this.animationPlaying){ + // this.rootArmature.updateAnimation(delta*this.timeScale, this.smoothAnimation); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.getTimescale = function(timeScale){ + this.timeScale = timeScale < 0 ? 0 : timeScale; // Suport negative timeScale (backward) ? +}; + +gdjs.SkeletonRuntimeObject.prototype.pauseAnimation = function(){ + this.animationPlaying = false; +}; + +gdjs.SkeletonRuntimeObject.prototype.unpauseAnimation = function(){ + this.animationPlaying = true; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationPaused = function(){ + return !this.animationPlaying; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimation = function(){ + return this.rootArmature.getCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimation = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimation(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimationName = function(){ + return this.rootArmature.getCurrentAnimationName(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimationName = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimationName(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.resetCurrentAnimation = function(){ + this.rootArmature.resetCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlot = function(slotPath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getBone = function(bonePath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlotX = function(slotPath){ + return 0; +}; + +gdjs.SkeletonRuntimeObject.prototype.setSlotX = function(slotPath, x){ +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithObject = function(slotPath, object){ + return false; +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithSlot = function(slotPath1, slotPath2){ + return false; +}; diff --git a/Extensions/SkeletonObject/Dskeletonslot.js b/Extensions/SkeletonObject/Dskeletonslot.js new file mode 100644 index 0000000000..20f9226d1a --- /dev/null +++ b/Extensions/SkeletonObject/Dskeletonslot.js @@ -0,0 +1,182 @@ + +/** +GDevelop - Skeleton Object Extension +Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) +This project is released under the MIT License. +*/ + + +/** + * The SkeletonRuntimeObject imports and displays skeletal animations files. + * + * @namespace gdjs + * @class SkeletonRuntimeObject + * @extends RuntimeObject + * @namespace gdjs + */ +gdjs.SkeletonRuntimeObject = function(runtimeScene, objectData){ + gdjs.RuntimeObject.call(this, runtimeScene, objectData); + + console.log("width: ", objectData.width); + console.log("height: ", objectData); + + this.rootArmature = new gdjs.SkeletonArmature(this); + this.animationPlaying = true; + this.animationSmooth = true; + this.timeScale = 1.0; + this.renderer = new gdjs.SkeletonRuntimeObjectRenderer(); + + var skeletalData = this.renderer.getData(objectData.skeletalDataFilename); + if(objectData.apiName === "DragonBones"){ + // Load the sub-textures + this.renderer.loadDragonBones(runtimeScene, objectData.textureDataFilename, objectData.textureName); + // Main loader + this.loadDragonBones(runtimeScene, skeletalData, objectData.rootArmatureName); + } +}; + +gdjs.SkeletonRuntimeObject.prototype = Object.create(gdjs.RuntimeObject.prototype); +gdjs.SkeletonRuntimeObject.thisIsARuntimeObjectConstructor = "SkeletonObject::Skeleton"; + +gdjs.SkeletonRuntimeObject.prototype.extraInitializationFromInitialInstance = function(initialInstanceData) { + if(initialInstanceData.customSize){ + this.setWidth(initialInstanceData.width); + this.setHeight(initialInstanceData.height); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.sayHello = function(){ + console.log(this); +}; + +gdjs.SkeletonRuntimeObject.prototype.loadDragonBones = function(runtimeScene, skeletalData, rootArmatureName){ + // Get the root armature with the given name + for(var i=0; i 0){ + this.rootArmature.loadDragonBones(skeletalData, 0, this.renderer.textures); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.setX = function(x){ + this.x = x; + this.rootArmature.setPos(x, this.y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setY = function(y){ + this.y = y; + this.rootArmature.setPos(this.x, y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAngle = function(angle){ + this.angle = angle; + this.rootArmature.setRot(angle); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleX = function(scaleX){ + this.scaleX = scaleX; + this.rootArmature.setScale(scaleX, this.scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleY = function(scaleY){ + this.scaleY = scaleY; + this.rootArmature.setScale(this.scaleX, scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setWidth = function(width){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.setHeight = function(height){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.getRendererObject = function(){ + return this.rootArmature.getRendererObject(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getHitBoxes = function(){ + return [this.rootArmature.getAABB()]; +}; + +gdjs.SkeletonRuntimeObject.prototype.update = function(runtimeScene){ + + var delta = this.getElapsedTime(runtimeScene) / 1000.0; + + // this.rootArmature.update(); + + if(this.animationPlaying){ + // this.rootArmature.updateAnimation(delta*this.timeScale, this.smoothAnimation); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.getTimescale = function(timeScale){ + this.timeScale = timeScale < 0 ? 0 : timeScale; // Suport negative timeScale (backward) ? +}; + +gdjs.SkeletonRuntimeObject.prototype.pauseAnimation = function(){ + this.animationPlaying = false; +}; + +gdjs.SkeletonRuntimeObject.prototype.unpauseAnimation = function(){ + this.animationPlaying = true; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationPaused = function(){ + return !this.animationPlaying; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimation = function(){ + return this.rootArmature.getCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimation = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimation(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimationName = function(){ + return this.rootArmature.getCurrentAnimationName(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimationName = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimationName(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.resetCurrentAnimation = function(){ + this.rootArmature.resetCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlot = function(slotPath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getBone = function(bonePath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlotX = function(slotPath){ + return 0; +}; + +gdjs.SkeletonRuntimeObject.prototype.setSlotX = function(slotPath, x){ +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithObject = function(slotPath, object){ + return false; +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithSlot = function(slotPath1, slotPath2){ + return false; +}; diff --git a/Extensions/SkeletonObject/Eskeletonarmature.js b/Extensions/SkeletonObject/Eskeletonarmature.js new file mode 100644 index 0000000000..9734406313 --- /dev/null +++ b/Extensions/SkeletonObject/Eskeletonarmature.js @@ -0,0 +1,83 @@ + +/** +GDevelop - Skeleton Object Extension +Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) +This project is released under the MIT License. +*/ + + +/** + * The SkeletonArmature hold the bones and slots/attachments as well as its animations. + * + * @namespace gdjs + * @class SkeletonRuntimeObject + * @extends RuntimeObject + * @namespace gdjs + */ +gdjs.SkeletonArmature = function(skeleton, parentArmature=null, parentSlot=null){ + gdjs.SkeletonTransform.call(this); + this.skeleton = skeleton; + this.parentArmature = parentArmature; + this.parentSlot = parentSlot; + this.name = ""; + this.bones = []; + this.bonesMap = {}; + this.slots = []; + this.slotsMap = {}; + this.animations = []; + this.animationsMap = {}; + this.currentAnimation = -1; + this.aabb = gdjs.Polygon.createRectangle(0, 0); + this.renderer = new gdjs.SkeletonArmatureRenderer(); + this._updateZ = false; + this._loaded = false; +}; + +gdjs.SkeletonArmature.prototype = Object.create(gdjs.SkeletonTransform.prototype); + +gdjs.SkeletonArmature.prototype.loadDragonBones = function(skeletalData, index, textures){ + +}; + +gdjs.SkeletonArmature.prototype.getRendererObject = function(){ + return this.renderer.getRendererObject(); +}; + +gdjs.SkeletonArmature.prototype.setPos = function(x, y){ +}; +gdjs.SkeletonArmature.prototype.setRot = function(angle){ +}; +gdjs.SkeletonArmature.prototype.setScale = function(sx, sy){ +}; + +gdjs.SkeletonArmature.prototype.getCurrentAnimation = function(){ + if(this.currentAnimation >= 0 && this.currentAnimation < this.animations.length){ + return this.animations[this.currentAnimation]; + } + return null; +}; + +gdjs.SkeletonArmature.prototype.getAABB = function(){ + return this.aabb; +}; + +gdjs.SkeletonArmature.prototype.getWidth = function(){ + return 1; +}; + +gdjs.SkeletonArmature.prototype.getCurrentAnimation = function(){ + return -1; +}; + +gdjs.SkeletonArmature.prototype.setAnimation = function(newAnimation, blendTime, loops){ +}; + +gdjs.SkeletonArmature.prototype.getCurrentAnimationName = function(){ + return ""; +}; + +gdjs.SkeletonArmature.prototype.setAnimationName = function(newAnimation, blendTime, loops){ +}; + +gdjs.SkeletonArmature.prototype.resetCurrentAnimation = function(){ +}; diff --git a/Extensions/SkeletonObject/Extension.cpp b/Extensions/SkeletonObject/Extension.cpp index c664e2637f..63789ae4e1 100644 --- a/Extensions/SkeletonObject/Extension.cpp +++ b/Extensions/SkeletonObject/Extension.cpp @@ -28,12 +28,318 @@ void DeclareSkeletonObjectExtension(gd::PlatformExtension & extension) SkeletonObject::LoadEdittimeIcon(); #endif - obj.AddAction("SayHello", - _("Say hello"), - _("Displays a welcome message"), - _("Say hello from _PARAM0_"), - _(""), + obj.AddCondition("AnimationPaused", + _("Paused"), + _("Test if the animation for the skeleton is paused"), + _("Animation of _PARAM0_ is paused"), + _("Animation"), "JsPlatform/Extensions/admobicon24.png", "JsPlatform/Extensions/admobicon16.png") .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddAction("PauseAnimation", + _("Pause"), + _("Pauses animation for the skeleton"), + _("Pause animation for _PARAM0_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddAction("UnpauseAnimation", + _("Unpause"), + _("Unpauses animation for the skeleton"), + _("Unpause animation for _PARAM0_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddExpression("AnimationPlaying", _("Playing"), _("Current animation playing (0: paused, 1: playing)"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("AnimationFinished", + _("Finished"), + _("Test if the animation has finished this frame"), + _("Animation of _PARAM0_ has finished"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("AnimationTime", + _("Current time"), + _("Check the current animation elapsed time."), + _("Current animation time of _PARAM0_ is _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddExpression("AnimationTime", _("Current time"), _("Current animation elapsed time"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("AnimationTimeLength", + _("Time length"), + _("Check the current animation time length."), + _("The animation time length of _PARAM0_ is _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddExpression("AnimationTimeLenght", _("Animation time length"), _("Current animation time length"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("AnimationFrame", + _("Current frame"), + _("Check the current animation frame.\nIf the animation is smooth, a float can be (and probably will be) returned."), + _("Current animation frame of _PARAM0_ is _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddExpression("AnimationFrame", _("Current frame"), _("Current animation frame"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("AnimationFrameLength", + _("Frame length"), + _("Check the current animation frame length."), + _("The animation frame length of _PARAM0_ is _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddExpression("AnimationFrameLenght", _("Animation frame length"), _("Current animation frame length"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("CurrentAnimation", + _("Animation"), + _("Check the current animation index.\nIf not sure about the index, you can use the \"by name\" action"), + _("Set the animation of _PARAM0_ to _PARAM1_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetAnimation", + _("Animation"), + _("Change the current animation from the animation index.\nIf not sure about the index, you can use the \"by name\" action"), + _("Set _PARAM0_ animation _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")) + .AddParameter("expression", _("Blend time (0 for automatic blending)"), "", true).SetDefaultValue("0") + .AddParameter("expression", _("Loops (0 for infinite loops)"), "", true).SetDefaultValue("-1"); + + obj.AddExpression("CurrentAnimation", _("Current animation index"), _("Current animation index"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddCondition("CurrentAnimationName", + _("Animation"), + _("Check the current animation name."), + _("The animation of _PARAM0_ is _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("string", _("Text")) + .SetManipulatedType("string"); + + obj.AddAction("SetAnimationName", + _("Animation name"), + _("Change the current animation from the animation name."), + _("Set _PARAM0_ animation _PARAM1_ _PARAM2_"), + _("Animation"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("operator", _("Modification's sign")) + .AddParameter("string", _("Text")) + .AddParameter("expression", _("Blend time (0 for automatic blending)"), "", true).SetDefaultValue("0") + .AddParameter("expression", _("Loops (0 for infinite loops)"), "", true).SetDefaultValue("-1"); + + obj.AddStrExpression("CurrentAnimationName", _("Current animation name"), _("Current animation name"), _("Animation"), "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton"); + + obj.AddAction("SetColor", + _("Color"), + _("Change the slot color."), + _("Set _PARAM0_ color to _PARAM2_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Sloth path")) + .AddParameter("color", _("Color")); + + obj.AddCondition("SlotPositionX", + _("Position X"), + _("Check the slot position X."), + _("Current position X of _PARAM0_:_PARAM1_ is _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetSlotPositionX", + _("Position X"), + _("Change the slot position X."), + _("Set _PARAM0_:_PARAM1_ position X _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddCondition("SlotPositionY", + _("Position Y"), + _("Check the slot position Y."), + _("Current position Y of _PARAM0_:_PARAM1_ is _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetSlotPositionY", + _("Position Y"), + _("Change the slot position Y."), + _("Set _PARAM0_:_PARAM1_ position Y _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")); + + obj.AddCondition("SlotAngle", + _("Angle"), + _("Check the slot angle."), + _("Current angle of _PARAM0_:_PARAM1_ is _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetSlotAngle", + _("Angle"), + _("Change the slot angle."), + _("Set _PARAM0_:_PARAM1_ angle _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")); + + obj.AddCondition("SlotScaleX", + _("Scale X"), + _("Check the slot scale X."), + _("Current scale X of _PARAM0_:_PARAM1_ is _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetSlotScaleX", + _("Scale X"), + _("Change the slot scale X."), + _("Set _PARAM0_:_PARAM1_ scale X _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")); + + obj.AddCondition("SlotScaleY", + _("Scale Y"), + _("Check the slot scale Y."), + _("Current scale Y of _PARAM0_:_PARAM1_ is _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("relationalOperator", _("Sign of the test")) + .AddParameter("expression", _("Value")) + .SetManipulatedType("number"); + + obj.AddAction("SetSlotScaleY", + _("Scale Y"), + _("Change the slot scale Y."), + _("Set _PARAM0_:_PARAM1_ scale Y _PARAM2_ _PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("object", _("Object"), "Skeleton") + .AddParameter("string", _("Slot path")) + .AddParameter("operator", _("Modification's sign")) + .AddParameter("expression", _("Value")); + + extension.AddCondition("SlotCollidesWithObject", + _("Collides"), + _("Check if the slot collides with an object"), + _("_PARAM0_:_PARAM1_ collides with _PARAM2_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("objectList", _("Skeleton"), "Skeleton") + .AddParameter("string", _("Sloth path")) + .AddParameter("objectList", _("Object")); + + extension.AddCondition("SlotCollidesWithSlot", + _("Collides with slot"), + _("Check if the slot collides with another skeleton slot"), + _("_PARAM0_:_PARAM1_ collides with _PARAM2_:_PARAM3_"), + _("Slot"), + "JsPlatform/Extensions/admobicon24.png", + "JsPlatform/Extensions/admobicon16.png") + .AddParameter("objectList", _("Skeleton"), "Skeleton") + .AddParameter("string", _("Sloth path")) + .AddParameter("objectList", _("Other skeleton"), "Skeleton") + .AddParameter("string", _("Sloth path")); } diff --git a/Extensions/SkeletonObject/Fskeletonanimation.js b/Extensions/SkeletonObject/Fskeletonanimation.js new file mode 100644 index 0000000000..20f9226d1a --- /dev/null +++ b/Extensions/SkeletonObject/Fskeletonanimation.js @@ -0,0 +1,182 @@ + +/** +GDevelop - Skeleton Object Extension +Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) +This project is released under the MIT License. +*/ + + +/** + * The SkeletonRuntimeObject imports and displays skeletal animations files. + * + * @namespace gdjs + * @class SkeletonRuntimeObject + * @extends RuntimeObject + * @namespace gdjs + */ +gdjs.SkeletonRuntimeObject = function(runtimeScene, objectData){ + gdjs.RuntimeObject.call(this, runtimeScene, objectData); + + console.log("width: ", objectData.width); + console.log("height: ", objectData); + + this.rootArmature = new gdjs.SkeletonArmature(this); + this.animationPlaying = true; + this.animationSmooth = true; + this.timeScale = 1.0; + this.renderer = new gdjs.SkeletonRuntimeObjectRenderer(); + + var skeletalData = this.renderer.getData(objectData.skeletalDataFilename); + if(objectData.apiName === "DragonBones"){ + // Load the sub-textures + this.renderer.loadDragonBones(runtimeScene, objectData.textureDataFilename, objectData.textureName); + // Main loader + this.loadDragonBones(runtimeScene, skeletalData, objectData.rootArmatureName); + } +}; + +gdjs.SkeletonRuntimeObject.prototype = Object.create(gdjs.RuntimeObject.prototype); +gdjs.SkeletonRuntimeObject.thisIsARuntimeObjectConstructor = "SkeletonObject::Skeleton"; + +gdjs.SkeletonRuntimeObject.prototype.extraInitializationFromInitialInstance = function(initialInstanceData) { + if(initialInstanceData.customSize){ + this.setWidth(initialInstanceData.width); + this.setHeight(initialInstanceData.height); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.sayHello = function(){ + console.log(this); +}; + +gdjs.SkeletonRuntimeObject.prototype.loadDragonBones = function(runtimeScene, skeletalData, rootArmatureName){ + // Get the root armature with the given name + for(var i=0; i 0){ + this.rootArmature.loadDragonBones(skeletalData, 0, this.renderer.textures); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.setX = function(x){ + this.x = x; + this.rootArmature.setPos(x, this.y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setY = function(y){ + this.y = y; + this.rootArmature.setPos(this.x, y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAngle = function(angle){ + this.angle = angle; + this.rootArmature.setRot(angle); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleX = function(scaleX){ + this.scaleX = scaleX; + this.rootArmature.setScale(scaleX, this.scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleY = function(scaleY){ + this.scaleY = scaleY; + this.rootArmature.setScale(this.scaleX, scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setWidth = function(width){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.setHeight = function(height){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.getRendererObject = function(){ + return this.rootArmature.getRendererObject(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getHitBoxes = function(){ + return [this.rootArmature.getAABB()]; +}; + +gdjs.SkeletonRuntimeObject.prototype.update = function(runtimeScene){ + + var delta = this.getElapsedTime(runtimeScene) / 1000.0; + + // this.rootArmature.update(); + + if(this.animationPlaying){ + // this.rootArmature.updateAnimation(delta*this.timeScale, this.smoothAnimation); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.getTimescale = function(timeScale){ + this.timeScale = timeScale < 0 ? 0 : timeScale; // Suport negative timeScale (backward) ? +}; + +gdjs.SkeletonRuntimeObject.prototype.pauseAnimation = function(){ + this.animationPlaying = false; +}; + +gdjs.SkeletonRuntimeObject.prototype.unpauseAnimation = function(){ + this.animationPlaying = true; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationPaused = function(){ + return !this.animationPlaying; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimation = function(){ + return this.rootArmature.getCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimation = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimation(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimationName = function(){ + return this.rootArmature.getCurrentAnimationName(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimationName = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimationName(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.resetCurrentAnimation = function(){ + this.rootArmature.resetCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlot = function(slotPath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getBone = function(bonePath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlotX = function(slotPath){ + return 0; +}; + +gdjs.SkeletonRuntimeObject.prototype.setSlotX = function(slotPath, x){ +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithObject = function(slotPath, object){ + return false; +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithSlot = function(slotPath1, slotPath2){ + return false; +}; diff --git a/Extensions/SkeletonObject/Gskeletonruntimeobject.js b/Extensions/SkeletonObject/Gskeletonruntimeobject.js new file mode 100644 index 0000000000..20f9226d1a --- /dev/null +++ b/Extensions/SkeletonObject/Gskeletonruntimeobject.js @@ -0,0 +1,182 @@ + +/** +GDevelop - Skeleton Object Extension +Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) +This project is released under the MIT License. +*/ + + +/** + * The SkeletonRuntimeObject imports and displays skeletal animations files. + * + * @namespace gdjs + * @class SkeletonRuntimeObject + * @extends RuntimeObject + * @namespace gdjs + */ +gdjs.SkeletonRuntimeObject = function(runtimeScene, objectData){ + gdjs.RuntimeObject.call(this, runtimeScene, objectData); + + console.log("width: ", objectData.width); + console.log("height: ", objectData); + + this.rootArmature = new gdjs.SkeletonArmature(this); + this.animationPlaying = true; + this.animationSmooth = true; + this.timeScale = 1.0; + this.renderer = new gdjs.SkeletonRuntimeObjectRenderer(); + + var skeletalData = this.renderer.getData(objectData.skeletalDataFilename); + if(objectData.apiName === "DragonBones"){ + // Load the sub-textures + this.renderer.loadDragonBones(runtimeScene, objectData.textureDataFilename, objectData.textureName); + // Main loader + this.loadDragonBones(runtimeScene, skeletalData, objectData.rootArmatureName); + } +}; + +gdjs.SkeletonRuntimeObject.prototype = Object.create(gdjs.RuntimeObject.prototype); +gdjs.SkeletonRuntimeObject.thisIsARuntimeObjectConstructor = "SkeletonObject::Skeleton"; + +gdjs.SkeletonRuntimeObject.prototype.extraInitializationFromInitialInstance = function(initialInstanceData) { + if(initialInstanceData.customSize){ + this.setWidth(initialInstanceData.width); + this.setHeight(initialInstanceData.height); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.sayHello = function(){ + console.log(this); +}; + +gdjs.SkeletonRuntimeObject.prototype.loadDragonBones = function(runtimeScene, skeletalData, rootArmatureName){ + // Get the root armature with the given name + for(var i=0; i 0){ + this.rootArmature.loadDragonBones(skeletalData, 0, this.renderer.textures); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.setX = function(x){ + this.x = x; + this.rootArmature.setPos(x, this.y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setY = function(y){ + this.y = y; + this.rootArmature.setPos(this.x, y); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAngle = function(angle){ + this.angle = angle; + this.rootArmature.setRot(angle); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleX = function(scaleX){ + this.scaleX = scaleX; + this.rootArmature.setScale(scaleX, this.scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setScaleY = function(scaleY){ + this.scaleY = scaleY; + this.rootArmature.setScale(this.scaleX, scaleY); +}; + +gdjs.SkeletonRuntimeObject.prototype.setWidth = function(width){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.setHeight = function(height){ + this.setScaleY(height / this.rootArmature.getWidth()); +}; + +gdjs.SkeletonRuntimeObject.prototype.getRendererObject = function(){ + return this.rootArmature.getRendererObject(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getHitBoxes = function(){ + return [this.rootArmature.getAABB()]; +}; + +gdjs.SkeletonRuntimeObject.prototype.update = function(runtimeScene){ + + var delta = this.getElapsedTime(runtimeScene) / 1000.0; + + // this.rootArmature.update(); + + if(this.animationPlaying){ + // this.rootArmature.updateAnimation(delta*this.timeScale, this.smoothAnimation); + } +}; + +gdjs.SkeletonRuntimeObject.prototype.getTimescale = function(timeScale){ + this.timeScale = timeScale < 0 ? 0 : timeScale; // Suport negative timeScale (backward) ? +}; + +gdjs.SkeletonRuntimeObject.prototype.pauseAnimation = function(){ + this.animationPlaying = false; +}; + +gdjs.SkeletonRuntimeObject.prototype.unpauseAnimation = function(){ + this.animationPlaying = true; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationPaused = function(){ + return !this.animationPlaying; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.isAnimationSmooth = function(){ + return this.animationSmooth; +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimation = function(){ + return this.rootArmature.getCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimation = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimation(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.getCurrentAnimationName = function(){ + return this.rootArmature.getCurrentAnimationName(); +}; + +gdjs.SkeletonRuntimeObject.prototype.setAnimationName = function(newAnimation, blendTime=0, loops=-1){ + this.rootArmature.setAnimationName(newAnimation, blendTime, loops); +}; + +gdjs.SkeletonRuntimeObject.prototype.resetCurrentAnimation = function(){ + this.rootArmature.resetCurrentAnimation(); +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlot = function(slotPath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getBone = function(bonePath){ + return null; +}; + +gdjs.SkeletonRuntimeObject.prototype.getSlotX = function(slotPath){ + return 0; +}; + +gdjs.SkeletonRuntimeObject.prototype.setSlotX = function(slotPath, x){ +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithObject = function(slotPath, object){ + return false; +}; + +gdjs.SkeletonRuntimeObject.prototype.slotCollidesWithSlot = function(slotPath1, slotPath2){ + return false; +}; diff --git a/Extensions/SkeletonObject/JsExtension.cpp b/Extensions/SkeletonObject/JsExtension.cpp index 76ea4b0be2..1a59b8b3ee 100644 --- a/Extensions/SkeletonObject/JsExtension.cpp +++ b/Extensions/SkeletonObject/JsExtension.cpp @@ -28,9 +28,16 @@ public: { DeclareSkeletonObjectExtension(*this); - GetObjectMetadata("SkeletonObject::Skeleton").SetIncludeFile("Extensions/SkeletonObject/skeletonruntimeobject.js"); + GetObjectMetadata("SkeletonObject::Skeleton") + .SetIncludeFile("Extensions/SkeletonObject/Gskeletonruntimeobject.js") + .SetIncludeFile("Extensions/SkeletonObject/Fskeletonanimation.js") + .AddIncludeFile("Extensions/SkeletonObject/Eskeletonarmature.js") + .AddIncludeFile("Extensions/SkeletonObject/Dskeletonslot.js") + .AddIncludeFile("Extensions/SkeletonObject/Cskeletonbone.js") + .AddIncludeFile("Extensions/SkeletonObject/Bskeletontransform.js") + .AddIncludeFile("Extensions/SkeletonObject/Askeletonruntimeobject-pixi-renderer.js"); - GetAllActionsForObject("SkeletonObject::Skeleton")["SkeletonObject::SayHello"].SetFunctionName("sayHello"); + GetAllActionsForObject("SkeletonObject::Skeleton")["SkeletonObject::SetSlotPositionX"].SetFunctionName("setSlotX").SetGetter("getSlotX"); GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION(); }; diff --git a/Extensions/SkeletonObject/SkeletonObject.cpp b/Extensions/SkeletonObject/SkeletonObject.cpp index a00c8ba2c2..10edbda221 100644 --- a/Extensions/SkeletonObject/SkeletonObject.cpp +++ b/Extensions/SkeletonObject/SkeletonObject.cpp @@ -31,26 +31,45 @@ SkeletonObject::SkeletonObject(gd::String name_) : std::map SkeletonObject::GetProperties(gd::Project & project) const { std::map properties; - properties[_("Main filename")].SetValue(filename); + properties[_("Skeletal data filename")].SetValue(skeletalDataFilename); + properties[_("Main armature name")].SetValue(rootArmatureName); + properties[_("Texture data filename")].SetValue(textureDataFilename); + properties[_("Texture")].SetValue(textureName); + properties[_("API")] + .SetValue(apiName) + .SetType("Choice") + .AddExtraInfo("DragonBones"); return properties; } bool SkeletonObject::UpdateProperty(const gd::String & name, const gd::String & value, gd::Project & project) { - if (name == _("Main filename")) filename = value; + if (name == _("Skeletal data filename")) skeletalDataFilename = value; + if (name == _("Main armature name")) rootArmatureName = value; + if (name == _("Texture data filename")) textureDataFilename = value; + if (name == _("Texture")) textureName = value; + if (name == _("API")) apiName = value; return true; } void SkeletonObject::DoUnserializeFrom(gd::Project & project, const gd::SerializerElement & element) { - filename = element.GetStringAttribute("mainFilename"); + skeletalDataFilename = element.GetStringAttribute("skeletalDataFilename"); + rootArmatureName = element.GetStringAttribute("rootArmatureName"); + textureDataFilename = element.GetStringAttribute("textureDataFilename"); + textureName = element.GetStringAttribute("textureName"); + apiName = element.GetStringAttribute("apiName"); } void SkeletonObject::DoSerializeTo(gd::SerializerElement & element) const { - element.SetAttribute("mainFilename", filename); + element.SetAttribute("skeletalDataFilename", skeletalDataFilename); + element.SetAttribute("rootArmatureName", rootArmatureName); + element.SetAttribute("textureDataFilename", textureDataFilename); + element.SetAttribute("textureName", textureName); + element.SetAttribute("apiName", apiName); } #if !defined(GD_NO_WX_GUI) diff --git a/Extensions/SkeletonObject/SkeletonObject.h b/Extensions/SkeletonObject/SkeletonObject.h index 527cf7f30e..92a6042ad3 100644 --- a/Extensions/SkeletonObject/SkeletonObject.h +++ b/Extensions/SkeletonObject/SkeletonObject.h @@ -36,7 +36,11 @@ private: void DoUnserializeFrom(gd::Project & project, const gd::SerializerElement & element) override; void DoSerializeTo(gd::SerializerElement & element) const override; - gd::String filename; + gd::String skeletalDataFilename; + gd::String rootArmatureName; + gd::String textureDataFilename; + gd::String textureName; + gd::String apiName; #if !defined(GD_NO_WX_GUI) static sf::Texture edittimeIconImage; diff --git a/Extensions/SkeletonObject/skeletonruntimeobject.js b/Extensions/SkeletonObject/skeletonruntimeobject.js deleted file mode 100644 index 94777d8fb9..0000000000 --- a/Extensions/SkeletonObject/skeletonruntimeobject.js +++ /dev/null @@ -1,36 +0,0 @@ - -/** -GDevelop - Skeleton Object Extension -Copyright (c) 2017-2018 Franco Maciel (francomaciel10@gmail.com) -This project is released under the MIT License. -*/ - - -/** - * The SkeletonRuntimeObject imports and displays skeletal animations files. - * - * @namespace gdjs - * @class SkeletonRuntimeObject - * @extends RuntimeObject - * @namespace gdjs - */ -gdjs.SkeletonRuntimeObject = function(runtimeScene, objectData){ - gdjs.RuntimeObject.call(this, runtimeScene, objectData); - - this.filename = objectData.mainFilename; -}; - -gdjs.SkeletonRuntimeObject.prototype = Object.create(gdjs.RuntimeObject.prototype); -gdjs.SkeletonRuntimeObject.thisIsARuntimeObjectConstructor = "SkeletonObject::Skeleton"; - -gdjs.SkeletonRuntimeObject.prototype.sayHello = function(){ - console.log(this.filename); -}; - -gdjs.SkeletonRuntimeObject.prototype.setLayer = function(layer){ - // No renderable object -}; - -gdjs.SkeletonRuntimeObject.prototype.setZOrder = function(z){ - // No renderable object -};