IMGUI按钮图标不正确对齐
我的图标在imgui :: button
中无法正常工作。我使用的自定义字体来自 iconfontCppheaders 。我的其他图标表现良好,但是网格的表现不正确。这是我的代码:
ImGui::Button(_transparency ? ICON_MD_GRID_ON "##enable###gridTransparency" : ICON_MD_GRID_OFF "##disable###gridTransparency")
此行用于仅以一个按钮更改图标,并且效果很好。 IMGUI中是否有可以在按钮中调整图标的标志?
My icon is not working properly in the ImGui::Button
. I'm using the custom font named material-design from IconFontCppHeaders. My other icons are perform nicely, but the grid one is not acting correct. Here is my code:
ImGui::Button(_transparency ? ICON_MD_GRID_ON "##enable###gridTransparency" : ICON_MD_GRID_OFF "##disable###gridTransparency")
This line is used to change the icon just in one button, and it works fine. Is there any flags in ImGui that can adjust icons in Button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
加载违规图标字体时,设置FontConfig.glyphoffset。这将使图标向下移动一些像素,并适当地对齐它们。
您需要尝试特定的值或比率
When Loading the offending icon font, set FontConfig.GlyphOffset.y an amount appropriate for the font size. This will shift the icons down a few pixels and align them appropriately.
You will need to experiment with specific values or ratios