slages / love-imgui

imgui module for the LÖVE game engine
MIT License
318 stars 61 forks source link

Add basic support for PushFont / AddFontFromFile #34

Closed Samulus closed 5 years ago

Samulus commented 5 years ago

Hi, I had the same problem as #33 so I made this PR. I ran into compilation issues trying to make PushFont in imgui_iterator.h adhere to your macro pattern so I figured I would just post what I have and let you modify it / make suggestions as needed. Thanks.

slages commented 5 years ago

Seems good, thanks a lot, I'll merge it. Can you give me a lua sample of using it?

Samulus commented 5 years ago

Sure: https://gist.github.com/Samulus/f69a9908a825c088b2c8fa1676daa67c

nkorth commented 4 years ago

Huh, I thought passing the ImFont into lua would be more complicated. I wrote SetGlobalFontFromFileTTF ( #10 ) as a hack because I didn't know how to do that. Feel free to delete it now that you're implementing proper font functions!