Skip to content

How do i add an n pixels gap between two widgets? #269

Answered by emilk
abhijeetbhagat asked this question in Q&A
Discussion options

You must be logged in to vote

item_spacing should work if you call it before adding the first of the two widgets (that's a bit counter-intuitive and is because spacing is applied after adding a widget)

But a more straightforward way is to call ui.advance_cursor(50.0);. I will rename that to ui.add_space(50.0); in the next release of egui.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abhijeetbhagat
Comment options

Answer selected by emilk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants