Large editable table in UI
Asked Answered
K

5

0

Hello everyone!

I am trying to create an editable table UI element with grid lines (like a very simple Excel document):

My first try was arranging LineEdit elements in a GridContainer and setting custom style boxes to get the grid lines. This looks as intended, but gets very slow for bigger tables. Creating a table with 50 columns and 150 rows takes over 3 seconds to display because of the sheer number of LineEdit elements.

I also tested with a Tree with a child for each row, and the respective number of columns, but here I do not have enough control over the look, e.g. I was not able to get vertical grid lines. Also the element placed for editing a field does not look nearly as seamless as when using multiple LineEdits in a GridContainer.

Does anyone have any tips on how to create potentially very large editable tables (hundrets of rows and columns) in Godot?

Any tips and hints would be greatly appreciated!

Thanks in advance and best regards,
Patrick

Kazue answered 16/1 at 0:11 Comment(0)
N
0

Kazue Profile the project to find out where the bottleneck is.
Btw. why would you want to do such thing in a game engine?

Nomo answered 16/1 at 0:17 Comment(0)
F
0

What about a grid of Labels, instead of LineEdits? When you click on one of them, it's overlayed with a LineEdit for editing, and then the Label is updated.

Fortdefrance answered 16/1 at 4:7 Comment(0)
K
0

Nomo

Thank you for your suggestion with the profiling; despite that I for now haven't gotten any informative results out of the profiling I will nevertheless look further into that. As to why to do such thing in a game engine: I just want to try out an idea for a very hybrid work-releated project, that I find quite many features of a game engine very helpful.

Best regards,
Patrick

Kazue answered 17/1 at 0:51 Comment(0)
K
0

Fortdefrance

Thank you very much for the idea; I'll have a think about it!

Best regards,
Patrick

Kazue answered 17/1 at 0:51 Comment(0)
F
0

I'm not sure that Labels would be faster than LineEdits. I would try a quick test first to check that.

Fortdefrance answered 17/1 at 1:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.