Hi,
Is it possible to define rectangular bounds for a section in screen space pixels? There is a function called .with_bounds() but in my understanding it can be only used to define the bounds from the section's origin up to the direction of layout settings.
Let us say I want to have a dialog box somewhere on my screen and render text inside that dialog box. If I move the text with motion inside the dialog box so that it reaches the edge of the dialog box and goes beyond it, the text should be clipped to the borders of the dialog box. There is no way to achieve this with .with_bounds() for every possible direction inside the dialog box?
Since a brush draws all of its sections at once, I don't see how I could make use of render_pass.set_scissor_rect for individual sections of the brush without creating a custom brush for every individual area on the screen I want to clip, which sounds pretty bad.
I use render_pass.set_scissor_rect for my other own UI elements to get this clipping effect. I separate draw calls that use clipping and draw calls that don't. Draw calls that use clipping are sorted by the clipping area, and each draw call set first calls render_pass.set_scissor_rect and then "draws" its draw calls.
Any thoughts on this?
Hi,
Is it possible to define rectangular bounds for a section in screen space pixels? There is a function called
.with_bounds()but in my understanding it can be only used to define the bounds from the section's origin up to the direction of layout settings.Let us say I want to have a dialog box somewhere on my screen and render text inside that dialog box. If I move the text with motion inside the dialog box so that it reaches the edge of the dialog box and goes beyond it, the text should be clipped to the borders of the dialog box. There is no way to achieve this with
.with_bounds()for every possible direction inside the dialog box?Since a brush draws all of its sections at once, I don't see how I could make use of
render_pass.set_scissor_rectfor individual sections of the brush without creating a custom brush for every individual area on the screen I want to clip, which sounds pretty bad.I use
render_pass.set_scissor_rectfor my other own UI elements to get this clipping effect. I separate draw calls that use clipping and draw calls that don't. Draw calls that use clipping are sorted by the clipping area, and each draw call set first callsrender_pass.set_scissor_rectand then "draws" its draw calls.Any thoughts on this?