html5 - JavaScript fillStyle usable with stroke()? -
In JavaScript, it is possible to use any type of stroke in No, it is not. To attract the HTML5 canvas, both have their own assets and methods for So if you want to fill the text, then we just use fillStyle () ?
Here is my code:
var text = document.getElementById ("text"); Var first = text.getContext ("2D"); First.font = "100px SimLLHP"; first. Stroke style = "blue"; First.strokeText ("T1", 100,100); Var final = text.getContext ("2D"); Last.font = "100px SimLLHP"; last. Stroke style = "blue"; last. Stroke Text ("T2", 110,180) stroke and throughout . For the stroke setting, such as the outline or lines and fill for the solid size therefore the fillStyle is only for filling, and for the stroke < Code> Stroke Style There is no reason to mix them. fillStyle with filltext .
var final = text.getContext ("2d"); Last.font = "100px SimLLHP"; Last.fillStyle = "blue"; Say we fill it and want a framework, then we fills first then stroke .
// I hope you will not pay attention to using "CTX", this is the most common one. Var ctx = text.getContext ("2d"); Ctx.font = "100px simLLHP"; Ctx.fillStyle = "blue"; Ctx.fillText ("T2", 10100); Ctx.strokeStyle = "red"; Ctx.strokeText ("T2", 10100);
Comments
Post a Comment