• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
ImGui, Lua and Font Icons

ImGui, Lua and Font Icons 1.0

Download now:  Join us with Level 2 access or earn your way in with  RedCents.
Other Authors
loki
Server Type
🏢 Live 🏘️ Emu TLP Test
We have both the Material Design and Font Awesome fonts included in our ImGui integration. But I wanted an easy way to display fonts for buttons and displays in my Lua scripts.

I tracked down some old C header files for Material Design and Font Awesome (much easier to work with UTF-8 than Unicode in Lua). Took those and converted them. This file, when included (and you have some kind of autocompletion in VSCode will provide an easy way to choose and use icons in your ImGui apps.

Put the file in the "lib" subdirectory in your Lua script folder and include the file
Lua include example:
local require ICON = require('lib.icons')

You'll get a full list of available Icons.
1645376483672-png.38205


Here's a quick loop to run through them all and display them in a window,
Icon Display Gui:
--- @type Mq
local mq = require('mq')

--- @type ImGui
require 'ImGui'

local ICON = require('lib.icons')

local openGUI = true
local shouldDrawGUI = true

local searchText = ""

local function DrawMainWindow()
    if not openGUI then return end
    openGUI, shouldDrawGUI = ImGui.Begin('Example Icon App', openGUI)
    if shouldDrawGUI then

        searchText = ImGui.InputText("Filter Icons", searchText, 100)
        searchText = trim(searchText)

        for key, value in pairs(ICON) do
            if string.len(searchText) <= 0 or string.match(key, searchText) then
                ImGui.Text(string.format('%s : %s', value, key))
            end
        end

    end
    ImGui.End()
end

function trim(s)
    return (s:gsub("^%s*(.-)%s*$", "%1"))
 end

mq.imgui.init('Icon Example', DrawMainWindow)

while openGUI do
    mq.delay(1000)
end

Which gives us output like this:

1645399936081-png.38218
Author
Coldblooded
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Coldblooded

Share this resource

Back
Top