Search the Community
Showing results for tags 'phaser frameworks'.
-
I have a game were the user put stickers on the stage. he can scale them and rotate... The PNG file is in a fitting size so the user can scale it without loosing quality. But, when I scale the image down it is crisp... Why is that and how can I fix it? Thank you :]
- 4 replies
-
- phaser frameworks
- image
-
(and 2 more)
Tagged with:
-
I'm trying to find a way to capture the canvas and save it on the device (any device - mobile and desktop). Right now I'm having difficulty with the first part (didn't get to the second one yet...) I'm trying the blob function but all I get is a black Square - even when the background on the canvas is gray or yellow... var canvas = document.getElementById("myCanvas");var imagData; var dataURL = canvas.toDataURL( "image/png" );var data = atob( dataURL.substring( "data:image/png;base64,".length ) ), asArray = new Uint8Array(data.length); for( var i = 0, len = data.length; i < len; ++i ) { asArray[i] = data.charCodeAt(i); }var blob = new Blob( [ asArray.buffer ], {type: "image/png"} );var img = document.createElement("img");img.src = (window.webkitURL || window.URL).createObjectURL( blob );document.body.appendChild(img);How do I capture the canvas with all of the graphics? And then, How do I save it on the device? Thanks in advance
- 3 replies
-
- phaser frameworks
- canvas
-
(and 1 more)
Tagged with:
-
I have dynamic sprites (classes) in a container sprite. When I change the x or y of the container nothings happens... this.menuContainer = this.game.add.sprite(0, 0);this.menuData.forEach(function(item){ obj = new DressApp.ItemBtn(this.state, xloc, yloc, this.boxImg.width, item); yloc += obj.container.bg.height; this.menuContainer.addChild(obj);}, this);Also, I can't set a graphic mask on that sprite. I tried both ways to define a mask but it still doesn't work.. var myMask = new PIXI.Graphics();//this.game.add.graphics(0, 0);//var maskWidth = this.boxImg.width;// - (this.boxImg.width * .2);var maskHeight = this.game.height * .90;myMask.beginFill(0x000000);myMask.moveTo(0, 0);myMask.lineTo(0, maskHeight);myMask.lineTo(maskWidth, maskHeight);myMask.lineTo(maskWidth, 0);myMask.lineTo(0, 0);myMask.endFill(); myMask.position.x = this.boxImg.x - (this.boxImg.width / 2);myMask.position.y = 0; this.menuContainer.mask = myMask;and var maskX = this.boxImg.x - (this.boxImg.width / 2);var maskY = 0;var maskWidth = this.boxImg.width;// - (this.boxImg.width * .2);var maskHeight = this.game.height * .90; var mymask = this.game.add.graphics(0, 0);mymask.beginFill(0xffffff);mymask.drawRect(maskX, maskY, maskWidth, maskHeight); this.menuContainer.mask = mymask;could somebody please help me..
- 1 reply
-
- phaser frameworks
- sprite
-
(and 2 more)
Tagged with: