Facepunch / sbox-issues

177 stars 12 forks source link

Gizmo.Draw.Text doesn't draw at the correct position in the Game view while the Scene view is open #4349

Open ryleigh opened 10 months ago

ryleigh commented 10 months ago

If you have the scene view open, Gizmo.Draw.Text draws at the wrong spot. Maximizing the game view doesn't fix it, but hiding the scene view completely does.

https://github.com/Facepunch/sbox-issues/assets/1173137/56a9ea38-d8c1-4d28-aa7a-34d38756702f

garrynewman commented 10 months ago

I suspect we can use similar code to the sprite shader to make this draw view independant. Ie, we send the vertex position, the size of the rect and the geometry shader turns that into triangles to draw on the screen.

Failing that we'd have a special sceneobject to re-project it on draw. Which tbh might be more useful going forward.