Hello Guest

Author Topic: tk2dTextMesh along a curved path?  (Read 3696 times)

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
tk2dTextMesh along a curved path?
« on: February 10, 2014, 08:35:08 pm »
Hello, I was wondering if it is possible to use tk2dTextMesh along a curved path? Is there a way to modify the current version to support it? Thanks.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dTextMesh along a curved path?
« Reply #1 on: February 11, 2014, 09:43:29 am »
No there isn't any support for that. It is possible.
tk2dTextGeomGen.SetTextMeshGeom sets the geometry
This line -
         cursorX += (chr.advance + data.spacing) * data.scale.x;
moves the cursor forward. If you can evaluate positions on your curve, you can pass that into cursorX and cursorY to move it in any way you like. If you want it to reorient glyphs to the tangent thats possible too. All the geometry generation happens in that one function.

fsadeq

  • 2D Toolkit
  • Sr. Member
  • *
  • Posts: 353
    • View Profile
Re: tk2dTextMesh along a curved path?
« Reply #2 on: February 12, 2014, 12:56:10 am »
Great, thanks. I'll dig into this and see what I can come up with.