# \[SOLVED\] Draw\_debug\_text not working in 1.7.0?

**URL:** <https://forum.defold.com/t/solved-draw-debug-text-not-working-in-1-7-0/76272>\
**Category:** Questions\
**Created:** [March 12, 2024, 8:00am UTC](https://forum.defold.com/t/solved-draw-debug-text-not-working-in-1-7-0/76272 "2024-03-12T08:00:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ackle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@ackle](https://forum.defold.com/u/ackle)\
**Post date:** [March 12, 2024, 8:00am UTC](https://forum.defold.com/t/solved-draw-debug-text-not-working-in-1-7-0/76272/1 "2024-03-12T08:00:16Z")

</div>

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:

```lua
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:

```lua
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:

```lua
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.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [March 12, 2024, 8:05am UTC](https://forum.defold.com/t/solved-draw-debug-text-not-working-in-1-7-0/76272/2 "2024-03-12T08:05:50Z")

</div>

Please, check release notes:

> [@Defold 1.7.0 has been released](https://forum.defold.com/t/defold-1-7-0-has-been-released/76266/1):
>
> This breaking change was implemented to clarify the usage of predefined fonts in `builtins`. The old `system_font.font` has been completely removed from the `builtins`, and two new fonts have been introduced:
> 
> 1. `builtins/fonts/default.font`, which uses the default df material and can serve as a font for the development process.
> 2. `builtins/fonts/debug/always_on_top.font`, which utilizes a special material `builtins/fonts/debug/always_on_top_font.material` with the `debug_text` tag. This font is intended to be drawn on top of other elements and is used for debugging purposes (such as the profiler and the `draw_debug_text` message) as replacement of old `system_font.font`. Additionally, changes are required in `default.render_script`, where the old `text` predicate has been replaced with the `debug_text` predicate for clarity.

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

---

<div class="post-metadata">

**Author:** ![ackle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@ackle](https://forum.defold.com/u/ackle)\
**Post date:** [March 12, 2024, 8:14am UTC](https://forum.defold.com/t/solved-draw-debug-text-not-working-in-1-7-0/76272/3 "2024-03-12T08:14:50Z")

</div>

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.)
