How should we add fillText properly?
See original GitHub issueI’m trying to configure some fillText
on the canvas, but I’m getting some undesired behavior.
Things I’ve tried thus far:
Initializing my progress ring, and directly after setting the fillText.
$('#ring').circleProgress({ ..... });
$("canvas")[0].getContext("2d").fillText("Test", 50, 50);
This approach results in no text being displayed.
Attaching a listener to circle-inited, and setting the text there.
$("#ring").on("circle-inited", function() {
$("canvas")[0].getContext("2d").fillText("Test", 50, 50);
});
$('#ring').circleProgress({ ..... });
I also tried attaching to circle-animation-end just to see if that would make a difference, but no dice.
The only thing that seems to work is attaching to circle-animation-progress
, but that obviously isn’t the approach I want to take.
I have console outputs to verify that my event listeners are getting called. Is there something else I should be doing to get this working properly?
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
HTML canvas fillText() Method - W3Schools
The fillText() method draws filled text on the canvas. The default color of the text is black. Tip: Use the font property to...
Read more >CanvasRenderingContext2D.fillText() - Web APIs | MDN
With that in hand, we set the font to 50-pixel-tall "serif" (the user's default serif font), then call fillText() to draw the text...
Read more >Getting Started with the HTML5 Canvas — Part 5 - Brenda Keller
The fillText() method adds solid-colored text to a drawing. The strokeText() method adds text as an outline with no fill. You can also...
Read more >how can render html tags in html5 canvas filltext() method?
The fillText() method can only take plain text and doesn't parse any tags within it. If your text is as simple as here...
Read more >fillText method (Internet Explorer) - Microsoft Learn
This method can return one of these values. Return code, Description. S_OK. The operation completed successfully. W3CException_DOM_SECURITY_ERR.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I hope I’ve helped you. I’m closing this ticket, but feel free to reopen.
Well I said that because it was working, but drawing multiple strings. Your way provides the proper way to use that route, so it’s certainly viable.