HTML5 Canvas - Text ontop of rectangle -



HTML5 Canvas - Text ontop of rectangle -

my code this

for(var = 0; < data.data.length; i++) { context.beginpath(); context.fillstyle = '#d0d0d0'; context.rect(data.data[i].x, data.data[i].y, 200, 25); context.fill(); context.linewidth = 1; context.strokestyle = 'black'; context.stroke(); context.fillstyle = 'black'; context.font = 'bold 20px serif'; context.filltext("1212a", data.data[i].x, data.data[i].y + 20); }

draws rectnagle stroke text beeing draw underneath rectangle tried changing order of code still underneath...

there there doesn't seem wrong code. problem might result of caching.

class="snippet-code-js lang-js prettyprint-override">var canvas=document.getelementbyid("main"); var context=canvas.getcontext("2d"); var x = 80; var y = 50; context.beginpath(); context.fillstyle = '#d0d0d0'; context.rect(x, y, 200, 25); context.fill(); context.linewidth = 1; context.strokestyle = 'black'; context.stroke(); context.fillstyle = 'black'; context.font = 'bold 20px serif'; context.filltext("1212a", x, y + 20); class="snippet-code-html lang-html prettyprint-override"><canvas id="main" width="300px" height="100px"> text displayed if browser not back upwards html5 canvas. </canvas>

html5 canvas

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

SQL Server : need assitance parsing delimted data and returning a long concatenated string -