2D Toolkit Forum

2D Toolkit => Support => Topic started by: fsadeq on February 10, 2014, 08:35:08 pm

Title: tk2dTextMesh along a curved path?
Post by: fsadeq 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.
Title: Re: tk2dTextMesh along a curved path?
Post by: unikronsoftware 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.
Title: Re: tk2dTextMesh along a curved path?
Post by: fsadeq on February 12, 2014, 12:56:10 am
Great, thanks. I'll dig into this and see what I can come up with.