From b4c5e58df310014e6f1cffca85d2e9f81347acf9 Mon Sep 17 00:00:00 2001 From: Madana Gopal Thirumalai Date: Tue, 17 Mar 2020 06:29:41 +0530 Subject: [PATCH] changes for keeping elements as root's child --- src/Lightning.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Lightning.js b/src/Lightning.js index f78f269..3f0909f 100644 --- a/src/Lightning.js +++ b/src/Lightning.js @@ -67,6 +67,7 @@ class SparkPlatform { let sparkImage = sparkscene.create({t:"image", resource:imageResource}); const sparkGl = this.stage.gl; sparkImage.ready.then( function(obj) { + sparkImage.parent = sparkscene.root; let texture = sparkImage.texture(); cb(null, {source: sparkGl.createWebGLTexture(texture), w: sparkImage.resource.w, h: sparkImage.resource.h, premultiplyAlpha: false, flipBlueRed: false, imageRef: sparkImage, flipTextureY:true}); }); @@ -99,6 +100,7 @@ class SparkPlatform { let imageObj = sparkscene.create({ t: "image", url:data}); imageObj.ready.then( function(obj) { + imageObj.parent = sparkscene.root; let canvas = {}; canvas.flipTextureY = true; canvas.internal = imageObj; @@ -131,6 +133,7 @@ class SparkPlatform { let imageObj = sparkscene.create({ t: "image", url:data}); imageObj.ready.then( function(obj) { + imageObj.parent = sparkscene.root; let canvas = {}; canvas.flipTextureY = true; canvas.internal = imageObj; @@ -150,6 +153,7 @@ class SparkPlatform { let imageResource = sparkscene.create({t:"imageResource", url:src, proxy:proxyServer}); let imageObj = sparkscene.create({ t: "image", resource:imageResource}); imageObj.ready.then( function(obj) { + imageObj.parent = sparkscene.root; let canvas = {}; canvas.flipTextureY = true; canvas.internal = imageObj;