Right here is the code which I used to create node and attempt to add element sprite runtime in node.
I’ve additionally added node as youngster to present node which is already proven in scene. spriteFrame additionally getting load correctly as I’ve seen in debug console of the chrome.
const runtimeNode = new Node('runtimenode');
sources.load('test_assets/customimage/spriteFrame',SpriteFrame,operate(err,spriteFrame){
if(err){
console.log(err);
return false;
}
runtimeNode.addComponent(Sprite).spriteFrame = spriteFrame;
});
this.node.addChild(runtimeNode);
Let me know if somebody already face identical challenge. let me know if I doing flawed right here.
Possibly you didn’t set the node’s layer,like this:
runtimeNode.layer = Layers.Enum.UI_2D