pkdawson / imgui-godot

Dear ImGui plugin for Godot 4
MIT License
318 stars 18 forks source link

ImGuiGd.Scale #44

Closed walker2011 closed 2 months ago

walker2011 commented 8 months ago

dynamic set "ImGuiGd.Scale" will raising error.

pkdawson commented 8 months ago

ImGuiGD.Scale can't be changed from inside a node's _Process method, I'm guessing that's the problem.

It should either be changed in _EnterTree or _Ready, or by using CallDeferred. See for example:

https://github.com/pkdawson/imgui-godot/blob/2e706a7be647289e8f3ff714a459d31461077d98/src/MySecondNode.cs#L136-L137

https://github.com/pkdawson/imgui-godot/blob/2e706a7be647289e8f3ff714a459d31461077d98/src/MySecondNode.cs#L159-L161