#Sprite Texture loaded programmatically does not show.

18 messages · Page 1 of 1 (latest)

young lily
#

As the title says. I'm trying to load a sprite programtically and using prints I've deduced it's in the right spot but I do not see the sprite. According to the position it says it's at when I ask it to print the art's global position it should be in the middle of the screen but it is not. If there's any other information I can provide please lmk!

hollow tundra
#

Hm, that's weird, can you show the local/remote node placement when the texture is added? I want to see it's position in the tree @young lily

young lily
#

Sorry I'm not sure I'm following

#

The Node and Sprite objects are created at runtime it was my understanding that objects created at runtime don't show up in the tree

#

But here's my whole tree if that's what you need?

#

Is it maybe because I never add that card object to as a child of the whole tree it's like freestanding or something?

#

not explaining myself well

hollow tundra
young lily
#

I wonder if I just slap it as a child of the Card Spot if that'll resolve it let me try that

hollow tundra
hollow tundra
young lily
#

Ok yeah that was it

hollow tundra
#

Yea, you just needed to add the card variable to the script itself in the end like :
Card.add_child(whatev)
Add_child(card)

young lily
#

mhm, did that and it worked

hollow tundra
young lily
#

tysm!

hollow tundra
hollow tundra