draw_text_to_render_target
Draws text onto a UTextureRenderTarget2D in the Unreal Engine 5 editor with engine font, color, scale, and pixel position. Use it to bake labels or overlays into render targets for later export.
Instructions
Draw a string onto a UTextureRenderTarget2D asset in one canvas pass in the editor world, in the engine's medium font (no font choice), tinted by color and scaled by scale, with position the text's top-left in render-target pixels. The text blends over the existing pixels: nothing is cleared, saved or undoable, and render-target contents live on the GPU only, so keep them with create_static_texture_from_render_target or export_render_target. A missing render target is an error; drawn is false, and the call fails, when nothing was drawn (an empty text, or no engine font: font_resolved says whether one was found). Related: draw_texture_to_render_target, draw_line_to_render_target, clear_and_fill_render_target.
Returns: { render_target_path: string, text: string, drawn: bool, font_resolved: bool, position: [number] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to draw | |
| color | No | Optional [r, g, b, a] text color, defaults to opaque white | |
| scale | No | Optional uniform number or [x, y] scale, default 1 | |
| position | No | Optional [x, y] text position, default [0,0] | |
| render_target_path | Yes | Asset path of the destination render target |