Unscaled/unblurred text that follow sprites

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aaron
:warning: Old Version Published before Godot 3 was released.

I have a scene with a camera - with zoom - and several sprite instances. Above each instance I want to show some text, like a name.

I’ve tried creating a font sized to fit the sprites and adding labels as children of the sprites, but the camera zoom causes the label text to blur. I can turn off filtering for the font but the scaling lets you see the anti-aliasing of the font close up, still making it look blurry. I tried making the font a distance field font but the letters appear malformed for some reason, making the labels unreadable.

:bust_in_silhouette: Reply From: ericdl

You could position a label above your sprite, get the camera’s zoom setting using camera.get_zoom, and scale the label with the zoom setting using the label.set_scale method. No need to mess around with fonts.

Here’s a sample project in which the scene’s root node has a float variable, and the camera and all sprite labels adjust themselves according to the variable every time it changes:
https://drive.google.com/file/d/0BwnfZQAEnciAYjBvaUtQY3hHVXM/view?usp=sharing