[SOLVED] Draw_debug_text not working in 1.7.0?

Hey all, I had started a simple application using 1.6.4, and was drawing some debug text to the screen, which worked fine. After switching to 1.7.0, my debug text no longer shows up. Looks like there were some internal engine changes regarding debug fonts and other things; is there anything I need to change in my scripts? Here are the relevant snippets (let me know if I should post more code):

Inside the render script, the orthographic camera is set to the following on init and window resize:

self.camera_gui = {
    view = vmath.matrix4(),
    proj = vmath.matrix4_orthographic(0, render.get_window_width(), 0, render.get_window_height(), -1, 1)
}
self.camera_gui.frustum = { frustum = self.camera_gui.proj * self.camera_gui.view }

And inside the update of the render script, there’s the following:

render.set_view(camera_gui.view)
render.set_projection(camera_gui.proj)
render.enable_state(render.STATE_STENCIL_TEST)
render.draw_debug3d()
render.draw(predicates.gui, camera_gui.frustum)
render.draw(predicates.text, camera_gui.frustum)
...

Finally, here’s my draw_debug_text message sent from another script:

msg.post("@render:", "draw_debug_text", { text = "[redacted]", position = vmath.vector3(10, 20, 1), color = vmath.vector4(1, 0, 0, 1) })

I should mention that elsewhere, I’m also posting the draw_line message to draw a frame around the viewport, and that works fine. Thanks for any help you can provide.

1 Like

Please, check release notes:

It seems like you use custom render_script, so you need to replace text predicate with debug_text predicate

2 Likes

Thanks, that worked. (I had seen that bit in the release notes earlier, but wasn’t quite parsing what it meant as I’m still new to the engine.)

2 Likes