Hi there!
I'm making plant specimen cards that should automatically generate based on textures in my game. I have everything else about the UI figured out, but I'm having issues with the left part meant to show scale of the whole plant next to an astronaut icon. I'd like all kinds of plants to fit exactly within this orange bounding box, but I'd like them to be centered at the bottom of the box, so they're on the black line like the astronaut. I can't figure out how to do that using anchors/offsets, grow direction, etc. in the textureRect options, the texture is always drawn at the top of the box. Is there a better way I could do this?
#Make a texture at the bottom center of textureRect bounding box
1 messages · Page 1 of 1 (latest)
are your images generated with that space below them?
Online API Reference for Image. You can also use the offline documentation by pressing F1 in Godot and searching for a class name.
You can crop the image like this
img = get_region(img.get_used_rect())
Nope, the images are SVGs with transparent bg, they’re only as big as the actual visually displayed plants.
Oooh thank you!! That could work. After sleeping on this I also realized I might just be able to like, stick this inside another control node and use the outer node as a “max size” bounding box, and align the inside texture to the bottom center of that using anchors :O I’ll try that when I get home