Jump to content

it is impossible to draw a rectangle stroke?


Mat-eria
 Share

Recommended Posts

I search in the forum, but did not find me it is impossible to draw a rectangle stroke.
The phaser did not see such a possibility (if not, please correct me). And of course I wrote does not work as (Do not know how this is done in webgl), but the canvas nuzhet contest (the problem is that I don `t know how to pass into another file, which resuet grid)

Link to comment
Share on other sites

Hi,

Easiest way to stroke a rectangle onto the canvas (while working with WebGL as well) is probably to use bitmapdata.  Think of it like a separate 2D canvas that you can use functions like strokeRectangle on.  Then, you can assign it to a sprite or just have it cover the entire screen while drawing on a portion of it, up to you.

Link to comment
Share on other sites

  • 1 month later...

It turned out there is no problem. If suddenly someone will need addressing, like me, then this problem is solved so
bmd = game.add.bitmapData (40,40);

bmd.ctx.beginPath ();
bmd.ctx.rect (0,0, sizeX, sizeY);
bmd.ctx.strokeStyle = sStyle;
bmd.ctx.stroke ();

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...