How do I use ImGuiListClipper for drawing a flow container of tiles
See original GitHub issueI am trying to simulate a scroll area and only draw the visible tiles…
var size = ImGui.GetContentRegionAvail();
var index = 0;
var count = Tiles.Length;
var clipper = new ImGuiListClipperPtr();
clipper.Begin((int)(size.X * size.Y), TileSizeY);
for (var i=0; i<Tiles.Length; i++)
{
if (ImGui.GetItemRectMax().X < size.X) ImGui.SameLine();
var image = Image(Tiles[index].GetTexture(), new(1,0), new(0,1));
Raylib.BeginTextureMode(image);
Raylib.DrawRectangleLines(0,0, TileSizeX, TileSizeY, Color.WHITE);
Raylib.EndTextureMode();
index++;
}
clipper.End();
- How exactly does the .net version of the listclipper work>?
- How would I simulate a fake scroll area without looping 60000 times?
- How do I get the min and max rows and columns of the visible scroll area?
Issue Analytics
- State:
- Created 6 months ago
- Comments:6
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Nevermind! I figured out that using this works without crashing
I have also pushed a workaround on dear imgui side: https://github.com/ocornut/imgui/commit/e95d66faa8e6c0255572632f34fad97a32f680cd