箇条書きでテキストを入れる
日本語はを入れると???で表示される。

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
bullet_wnd = float_wnd_create(200, 80, 1, true)
float_wnd_set_title(bullet_wnd, "imgui Demo")
float_wnd_set_imgui_builder(bullet_wnd, "bullet_demo")
float_wnd_set_onclose(bullet_wnd, "closed_demo")
function bullet_demo(wnd, x, y)
-- 箇条書きスタイルの列挙を作成する
imgui.Bullet(); imgui.TextUnformatted("Bulletあいう")
imgui.Bullet(); imgui.TextUnformatted("Style")
imgui.Bullet(); imgui.TextUnformatted("Enumeration")
end
function closed_demo(wnd)
-- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
-- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end
区切り線を入れる
セパレーター(横の区切り線)、ウインドウの横一杯に入る。

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
separator_wnd = float_wnd_create(200, 80, 1, true)
float_wnd_set_title(separator_wnd, "imgui Demo")
float_wnd_set_imgui_builder(separator_wnd, "separator_demo")
float_wnd_set_onclose(separator_wnd, "closed_demo")
function separator_demo(wnd, x, y)
-- 区切り線を引く
imgui.Separator()
end
function closed_demo(wnd)
-- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
-- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end
プログレスバーの表示

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
ProgressBar_wnd = float_wnd_create(300, 80, 1, true)
float_wnd_set_title(ProgressBar_wnd, "imgui Demo")
float_wnd_set_imgui_builder(ProgressBar_wnd, "ProgressBar_demo")
float_wnd_set_onclose(ProgressBar_wnd, "closed_demo")
function ProgressBar_demo(wnd, x, y)
-- プログレスバーを表示、1 = 100%
imgui.ProgressBar(0.5)
end
function closed_demo(wnd)
-- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
-- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end
ツールチップ(説明領域)の作成

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
tooltip_wnd = float_wnd_create(200, 100, 1, true)
float_wnd_set_title(tooltip_wnd, "imgui Demo")
float_wnd_set_imgui_builder(tooltip_wnd, "tooltip_demo")
float_wnd_set_onclose(tooltip_wnd, "closed_demo")
function tooltip_demo(wnd, x, y)
--まず、チェックボックスを作成
_, makeRed = imgui.Checkbox("Complicated Item", makeRed)
if imgui.IsItemActive() then
-- アイテムがクリックされている間に説明流域が表示されるツールチップを作成できます。
imgui.BeginTooltip()
-- この関数は、ツールボックス内のラッピングを構成し、それによってその幅を構成します
imgui.PushTextWrapPos(imgui.GetFontSize() * 10)
imgui.TextUnformatted("Here's a long explanation text that describes the purpose of this widget")
-- ラッピングをリセットします。これは、PushTextWrapPos を使用した場合は常に行う必要があります。
imgui.PopTextWrapPos()
imgui.EndTooltip()
end
end
function closed_demo(wnd)
-- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
-- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end
ボタン等に同じ文字列を使う場合、誓約がある
同じ名前で作成する場合、誓約があって使う場合注意が必要。

-- imgui はフローティング ウィンドウ内でのみ機能するため、最初に作成する必要があります。
button_wnd = float_wnd_create(150, 200, 1, true)
float_wnd_set_title(button_wnd, "imgui Demo")
float_wnd_set_imgui_builder(button_wnd, "button_demo")
float_wnd_set_onclose(button_wnd, "closed_demo")
function button_demo(wnd, x, y)
-- キャプション文字列は、ウィンドウ内で一つでなければならないことに注意してください!
-- 同じキャプション(Button)を持つ複数のウィジェットが必要な場合は、## の後に、非表示のキャプション拡張の一意の ID を追加します。
imgui.Button("ButtonA##1")
imgui.Button("ButtonA##2")
-- 別のバリエーション: ループ内からウィジェットを作成する場合に備えて、PushID と PopID を使用してカスタム ID 名前空間を作成します。
for i = 1, 5 do
imgui.PushID(i)
imgui.Button("ButtonB")
imgui.PopID()
end
end
function closed_demo(wnd)
-- Tこの関数は、ユーザーがウィンドウを閉じるときに呼び出されます。
-- ウィンドウが既に破棄されているため、この関数では imgui 関数の描画または呼び出しは許可されない。
end