Drawing text in split screen
I'm trying to draw text in immediate mode on one half of the screen. But the text is misaligned, draws on the entire screen, and is stretched by a factor of the viewport rect.
This is how it looks, names are rendered using the same position as the black lines. The only value changing in this gif is the viewport rect of the left camera, changing its width from 0.5 to 1. A similar effect occurs when reducing the height.
This is the draw command
using (Draw.Command(cam, (UnityEngine.Rendering.Universal.RenderPassEvent)renderQueue)) { if (fontAsset != null) Draw.Font = fontAsset; Draw.FontStyle = textStyle; Draw.FontSize = fontSize; Draw.TextAlign = TextAlign.Center; Draw.Color = textColor; foreach (var station in stations) { Draw.Text(station.WorldPosition + textOffset, station.name); } }
from where are you calling this code?