imgui フォントの作成 – FlyWithLua

2023年2月17日

日本語は使えない。大きくするとぼやける。

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
child_wnd = float_wnd_create(500, 100, 1, true)
float_wnd_set_title(child_wnd, "imgui Demo")
float_wnd_set_imgui_builder(child_wnd, "child_demo")
float_wnd_set_onclose(child_wnd, "closed_demo")


function child_demo(wnd, x, y)
    imgui.PushStyleColor(imgui.constant.Col.Text, 0xFFA89300) -- 濃いアーティック ブルーのテキスト
    imgui.TextUnformatted("We cannot curently change the font we can change the color")
    imgui.SetWindowFontScale(1.5)
    imgui.TextUnformatted("We can also change the scale")
    imgui.SetWindowFontScale(1.0)
    imgui.TextUnformatted("Because this is the font scale for the window we need to make sure")
    imgui.TextUnformatted("we have changed it back to the default of 1.0.")
    imgui.PopStyleColor()
end

function closed_demo(wnd)
    -- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。 
    -- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end