I've build a level editor for Breakout/Arkanoid.
I have it saving all the brick placement, colour and other info required as json data.
I have it loading the json data.
I have it drawing bricks on the screen on load.
SCHWEET! Things are looking spivvy! :-)
The problem is, it loads the original brick scene file, with the same texture.
I now want to have it, that when it loads the json data it changes the texture of the instanced brick file.
So I have a couple of ideas, but I can't seem to execute either:
Change the texture BEFORE instancing.
I like this idea. I can change the texture of the TSCN file, then instance it. Repeat for each instance. Unfortunately I just can't figure out how to do this. I can use
get_node() to get an already instanced node, but not to one that's not instanced yet.
Change the texture AFTER instancing.
This should be easy. Instance node. get_node(). Change texture.
My problem is, I don't know how to get the name of the last added instance so I can do this. If I could work that out I could do something like
Can anyone offer advice on any of those options, or even suggest something else?
Thanks so much...