Feature Request: Curved Text

Avatar
  • updated
  • Completed
Youtube video

My game uses many circles for the world interface and I would like to request a draw function specifically for curved text. I was going to do this myself, but I consulted with a friend who has a lot more experience with shapes than me and he said he had no idea how to go about implementing this. What would be perfect would be a Draw.CurvedText() function with three additional overrides, startAngle, locus and radius. This could inherit from Draw.Text(). Start angle would be the start of the text, much like an offset, locus would be the offset point at which the text rotates around and radius is the size of the locus. 

I've added a reference image below. I'm also open to other implementations. All I want is to align text along my circles.

Image 857

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
URP
Avatar
richard rothkugel
Quote from Freya Holmér

well you managed to math snipe me into adding this as a weekend leisure activity bc I have an obsession with curvature as a concept 💀 I've now added two new properties in 4.5.0:

Draw.TextCurvature

This sets the curvature of the text. when 0, the text is straight. When positive, it bends in the positive direction, when negative, it bends the other way

Draw.TextCurvaturePivot

This determines which point in the text will remain fixed, when bending. Usually you'll want to leave this at its default value of (0,0)

Image 858

Amazing. Greatly appreciate your work. I'll implement these into my UI and report back.

Avatar
Freya Holmér creator
  • Completed

well you managed to math snipe me into adding this as a weekend leisure activity bc I have an obsession with curvature as a concept 💀 I've now added two new properties in 4.5.0:

Draw.TextCurvature

This sets the curvature of the text. when 0, the text is straight. When positive, it bends in the positive direction, when negative, it bends the other way

Draw.TextCurvaturePivot

This determines which point in the text will remain fixed, when bending. Usually you'll want to leave this at its default value of (0,0)

Image 858