drhayes Posted December 2, 2014 Share Posted December 2, 2014 Hey there. I'm making a pixel art game and and trying to see if it will work in Panda using WebGL. I can't get the pixels to not be blurry. Here's an example of how the sprite looks right now: Here's my config:pandaConfig = { name: 'MyPandaGame', version: '0.0.0', system: { width: 320, height: 240, scaleToFit: true, webGL: false }};Here's my main.js:game.module( 'game.main').require( 'game.assets', 'game.objects').body(function() { game.addAsset('player.png'); game.PIXI.scaleModes.DEFAULT = game.PIXI.scaleModes.NEAREST; game.createScene('Main', { init: function() { var player = new game.SpriteSheet('player.png', 16, 16); var anim = player.anim(); anim.animationSpeed = 0.2; anim.play(); anim.position.set(100, 100); anim.addTo(this.stage); } });});Anyone have any ideas? No combination of anything I've read makes those zoomed-in pixels be less blurry. Is there a non-WebGL option that would make it less blurry as well? Quote Link to comment Share on other sites More sharing options...
enpu Posted December 2, 2014 Share Posted December 2, 2014 Try to set your canvas bigger (like 640x480) and then scale your stage:this.stage.scale.set(2, 2);Also you can set nearest scaling in config file:system: { scaleMode: 'nearest'} drhayes 1 Quote Link to comment Share on other sites More sharing options...
drhayes Posted December 2, 2014 Author Share Posted December 2, 2014 Hot damn! That fixed it for me! Thank you so much! Is this written up somewhere that I missed? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.