Feature Request: Text stroke color/width

0 favourites
  • 7 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hi,

    I'd like to request an addition to the Text plugin: the ability to define stroke color and width for text.

    I modified the official Text plugin to do it, as a test. I added Stroke Color and Stroke Width properties, then inside the text.draw method set ctx.strokeStyle and ctx.lineWidth to the user-defined values. It worked as expected in Firefox, Chrome, Edge and even I.E., so I hope this is just a standard browser feature that can be supported.

    I'm a Javascript novice, and I'm sure there are gotchas that I don't know about, but it was so easy for me to hack something in I'm hopeful it's not a huge ask to get official support.

    Thank you!

  • As more expirienced developer I suggest you to not mess with official plugins,

    because every Construct 2 update may conflict with your upgrades.

    If you want your modifications, better to duplicate the Text plugin call it for example "Super Text" and change it.

    But even better to use already writen plugin that solves your request:

    https://www.scirra.com/forum/plugin-tag-text_t92363

    But I agree, outline could be a good addition to the official Text plugin.

  • Thanks for pointing out the tag text plugin, Yura G. I didn't know about that one, and it looks like it'll do all I wanted and then some.

    The thing is, I normally avoid using third-party plugins since they aren't guaranteed to be supported and I've often found them to be buggy. It sucks to invest time into integrating some plugin only to realize it isn't reliable and/or isn't supported by the author. I might break down and use this one since rex is so active, but I would still love to see official support for more text options.

    I don't make direct changes to official plugins btw, for the reason you mentioned. I made a copy of the text plugin with my changes to test that what I was asking for could be done easily. But still, I wish I had named it "Super Text"... I called it "Text Stroke" which now seems very boring.

  • Hi

    SuperRex add a Stroke parameter in his plugin TagText but not the possibility to modify Stroke width.

    Do you think it would be possible you send me your custom text plugin with stroke width, just to understand how you made the change ?

  • Hi

    SuperRex add a Stroke parameter in his plugin TagText but not the possibility to modify Stroke width.

    Do you think it would be possible you send me your custom text plugin with stroke width, just to understand how you made the change ?

    Hey amkp, I will try to dig that up, sure. I may have deleted it though, so in the meantime here's an example of stroke width in pure HTML/JS.

    http://www.html5canvastutorials.com/tut ... xt-stroke/

    If I recall, I just added ctx.lineWidth to the draw call, and exposed a number variable for it in the editor. I also exposed a variable for the stroke color in the same way the text color was done. Mostly copy/paste stuff tbh.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for your answer

    Rex has updated his plugin TagText, so the stroke option with border width is now available:

    https://www.scirra.com/forum/viewtopic.php?f=153&t=92363&p=1100592&sid=16ff5b639bcf4860b7428c8446ed5a51#p1100592

  • Thanks for your answer

    Rex has updated his plugin TagText, so the stroke option with border width is now available:

    https://www.scirra.com/forum/viewtopic.php?f=153&t=92363&p=1100592&sid=16ff5b639bcf4860b7428c8446ed5a51#p1100592

    Great amkp, thanks for the heads-up! That's good since I believe I deleted my test plugin.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)