Jump to content

resolution svg ugly ...Why ?


espace
 Share

Recommended Posts

hi,

on my inkskape i have an svg image (500 pixel/500pixel) ---> (see my first image)

when i incorporate this image on my game the resolution is ugly ---> (see my second image)

whenever my resolution on my game is correct :

var game = new Phaser.Game(640,960, Phaser.AUTO, "game");

Did you know what happens ?

02.png

01.png

Link to comment
Share on other sites

Phaser doesn't support SVG, only rasters.

When you load an SVG file in as an Image (which is what you've done here) it gets rasterised on load. Then the raster version is used for your Sprites, etc. Hence the jaggies.

The rasterisation takes place automatically, it isn't something Phaser does (the browser does it). I'd suggest seeing what happens if you try doing something like doubling the size of the SVG, do you get a better, less jagged, result? If not then it's entirely possible it basically looks as good as it's going to get from this way of importing SVGs, without first rendering them to PNGs yourself.

Link to comment
Share on other sites

There you go then, I guess it doesn't matter what 'size' the SVG is, the browser will render it quite tiny when converted to an Image tag (which is essentially what is happening).

The solution is simple: don't use SVG. There's no alternative I'm afraid.

Link to comment
Share on other sites

I have used svg images with phaser and they scale very well.

Although they dont work on firefox.That's not a problem for me because I only make Android games that run on crosswalk.

Can you try your svg on Chrome?

You can also install the game in my signature and see for yourself the images are fine. Even if you install the game on an Android TV (large living room TV), phaser will scale it.

Link to comment
Share on other sites

hi@bruno

svg work perfectly in chrome. a lower resolution 50/50 px is perfectly scaled to the screen.

i have an another problem due to chrome. i explain :

i start a server with python :

sudo python -m SimpleHttpServer 80 

access my index.html via localhost

ok it works but after a certain delay my change on my js.files are not considered.

i must close this server and chrome and restart those services and it works again....:(

what's your solution to start a server with chrome...have you the same problem than me ?

Link to comment
Share on other sites

I haven't tried sprite animation. In those I used png.

As for the server I didn't have any problems, but I use IIS that comes with Windows 10.

Is it a cache problem? When you make changes try to refresh with Ctrl+F5 to ignore files in cache. Or use private browsing (Ctrl+Shift+N).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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