Search the Community
Showing results for tags 'bitmapRendering'.
-
Hello everyone, I am new here in phaser and javascript. I come from openfl (if you don't know what that is then take a look at www.openfl.org and have fun). I am on a jigsaw puzzle game quest. but for all quests there are always issues; and I have two issues for which I cannot find an answer even with this artefact called google. my first issue is: I have successfully made my first phaser game ( this jigsaw puzzle ) work on mozilla Firefox and Google. but on Internet explorer, it doesn't work at all! and my second is: I need to resize the images that the game will use. the images will have many different sizes, sometimes bigger and sometimes smaller than the desired image size, Nevertheless those images need to be resized to the desired size. ok, first hear me out: I have made some researches about how to make a jigsaw puzzle here. and I find out some nice tips: var bitmap = game.make.bitmap(); var graphics = bitmap.context; //then drawing the jigsaw piece to your heart content graphics.moveTo(0,0); graphics.UNTILYOURJIGSAWISDONE(); // //then comes the best part, clipping the image to be drawn graphics.clip(); //finally having our image graphics.drawImage(img,x,y); this is what I have found out to be working. Thus I created a class making pieces, jigsaw pieces and have a puzzle working fine on Firefox and Google chrome. for my resizing problem, the main problem is that img cannot be a Phaser.Sprite nor a Phaser.Image for more infos check https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage I thought about some possible answers for the resizing problem. the answer lies in resizing the image in pure javascript. without showing it. but for Internet Explorer one: I have no idea Any help will be great
- 2 replies
-
- phaser
- javascript
-
(and 2 more)
Tagged with: