I have a function where I create a RectTexture and set its texture and scale like this:
func create_hover_preview(item):
hover_preview = TextureRect.new()
add_child(hover_preview)
yield(get_tree(),"idle_frame")
hover_preview.texture = item.texture
hover_preview.rect_scale = Vector2(2,2)
The texture is applied to the node even without the yield but the node is never scaled
but something like this works:
func create_hover_preview(inv_grid:Object, idx:int, item:Item):
hover_preview = TextureRect.new()
add_child(hover_preview)
hover_preview.texture = item.texture
rescale(hover_preview)
func rescale(hover_preview):
yield(get_tree(),"idle_frame")
hover_preview.rect_scale = Vector2(4,4)
Shouldn't both of these work exactly the same? what am I missing?