Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Stroke text via code in HTML5 canvas

Participant ,
Apr 12, 2023 Apr 12, 2023

Good evening everyone, in the HTML5 canvas is it possible to add a stroke to a text with a line of code? as done, for example, to add a shadow:
this.shadow = new createjs.Shadow("rgba(0,0,0,0.9)",0,0,9);

thank you all so much for any help!

TOPICS
Ad development , Code , How to
723
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 13, 2023 Apr 13, 2023

Hi.

 

Set a value bigger than 0 to the outline property. For example:

this.yourTF.outline = 2;

 

If needed, place two text fields over each other to keep the fill and the stroke.

 

Regards,

JC

Translate
Community Expert ,
Apr 12, 2023 Apr 12, 2023
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 13, 2023 Apr 13, 2023

thank you very much but maybe i misunderstood, i already have some text, i need to add an outer border to this text using code instead of converting it to shape and manually adding the stroke to each letter...

it can probably be done with a trick using a multiple shadow as well but I'm not very handy with the code in the html5 canvas

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2023 Apr 13, 2023

Sorry, I wasn't helpful. Hopefully, you get it figured out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 19, 2023 Apr 19, 2023

Thanks anyway, any help is always helpful! Thanks again

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2023 Apr 13, 2023

Hi.

 

Set a value bigger than 0 to the outline property. For example:

this.yourTF.outline = 2;

 

If needed, place two text fields over each other to keep the fill and the stroke.

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2023 Apr 20, 2023
LATEST

This is good information JoãoCésar

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines