Closed gdinit closed 5 years ago
Hi gdinit,
Thanks for the pull! So far I've never edited the imgui code for the bindings and I would prefer to keep it this way. And actually it would be best to implement it by making PushFont available.
The idea would be to transform SetGlobalFontFromFileTTF to something more generic like AddFontFromFileTTF, and maybe returning an ID to be used for PushFont.
Hello slages, Thanks for your response. I understand the concern. I will close this PR then. The method you described sounds fine also, I do hope it gets implemented some time not too distant.
As per title, this commit adds functionality to change default font to one of the preloaded fonts at runtime.
Usage: imgui.SetDefaultFontLua(".", fontIndex)
pseudo code Here is a gist showing how I'm using it at the moment (excerpt from actual much longer main.lua): https://gist.github.com/gdinit/92e29769954b28a25d2dbe067c1a03f2#file-main-lua-L112