[游戏开发]imgui介绍

本文介绍了如何使用C/C++和C#进行Imgui游戏开发,包括创建窗口、添加文字和显示图片。创建窗口的函数允许自定义打开状态和样式;文字支持格式化;图片展示时,以字体图片为例,需要注意图片比例和渲染尺寸的匹配。
摘要由CSDN通过智能技术生成

创建窗口

    ImGui::Begin("Hello, world!");
    ImGui::End();

1328440-20190714163214190-1756550036.png
其中, ImGui::Begin("Hello, world!");函数的原型是IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0);
p_open决定了他是否是打开状态,flags决定了他的样式。
flags是一个整数,表示你需要的样式的和,以下是所有的flag

    ImGuiWindowFlags_None                   = 0,
    ImGuiWindowFlags_NoTitleBar             = 1 << 0,   // Disable title-bar
    ImGuiWindowFlags_NoResize               = 1 << 1,   // Disable user resizing with the lower-right grip
    ImGuiWindowFlags_NoMove                 = 1 << 2,   // Disable user moving the window
    ImGuiWindowFlags_NoScrollbar            = 1 << 3,   // Disable scrollbars (window can still scroll with mouse or programmatically)
    ImGuiWindowFlags_NoScrollWithMouse      = 1 << 4,   // Disable user vertically scrolling with mouse wheel. On child window, mouse whe
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值