Skip to content

ResourceLoader won't load texture passed into IMGUI #117

@SneakBug8

Description

@SneakBug8

On Godot v4.5.1 with CSharp using GDScript ResourceLoader won't load texture passed into IMGUI properly, unless it was used in some other control node before.

This example will render an empty rect, unless I uncomment # TexturePreviewRect.texture = tex.

@export var TexturePreviewRect : TextureRect

...
static func getNationFlag(tag: String) -> Resource:
	return load("res://gfx/flags/" + tag + ".png")

func DisplayNationWindow(nationId: int) -> void:
	...
	
	var tex = getNationFlag(nation["tag"]);
	ImGui.Image(tex, tex.get_size() / 2)
	# TexturePreviewRect.texture = tex
        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions