Jump to content

Phaser and Vector Art?


aberrantmind
 Share

Recommended Posts

so I do a lot of art stuff, and have been coding for about 9 months now. I'm just starting to dip my toes into vector art and was wondering if anyone has any experience with loading vector art into phaser? is that even a thing?

 

edit: of course immediately after I hit post I find this post http://www.html5gamedevs.com/topic/2491-how-do-you-create-your-visuals/?hl=vector,

 

edit2: but that post doesn't really answer my question now that I've read through the whole thing... COFFEE!

Link to comment
Share on other sites

sorry I think I was unclear in my op. I wasn't asking about personal preference(I have a good amount of xp with pixel art). What I was asking about was how to load vector art.

 

I've been going through the docs, there are a couple of bitmap classes that I think is along those lines. I've been messing with inkscape and see I can save as svg or export bitmap data, so I'm guessing I have to load the exported data somehow but figured I'd see if I'm heading down the right path or not.

Link to comment
Share on other sites

I'm going to hazard a guess that people who use vector art for their Phaser or like-engined games,  design their images in vector graphics and then freeze that art as png files at two or perhaps three sizes.  The idea would be to load in the correct size image for the current display resolution.  This is pretty much what my partner and I am doing.  If there is a better or different way, I'd like to hear about it.

Link to comment
Share on other sites

Basically as mwatt said - design in vector if you like, but at the end of the day canvas has to represent it as a bitmap if you want any kind of performance out of it. There are ways to parse vector data into canvas draw calls and draw it all on the fly - but doing so in a game? I'd rather roll in glass in my birthday suit.

 

You could render them to hidden canvases at runtime (like EaselJS does) but the memory overhead, the rendering time, for no real benefit :( I guess it means you could have more elaborate looking animations, created in Flash, running in a game - but yet again probably only really useful for cut-scenes or intros, and definitely not optimal for WebGL.

Link to comment
Share on other sites

  • 1 year later...

No benefit. Not sure what you mean there, it is damn hard to figure out what dimensions to expect the game will be played in. Just for mobile phones there is a massive difference in resolution between different models. For symbols in my app, I will probably have to render at 12x and scale down by an  integer number. And even knowing that it's tricky figuring out where to position and how to crop assets.

Link to comment
Share on other sites

No benefit. Not sure what you mean there, it is damn hard to figure out what dimensions to expect the game will be played in. Just for mobile phones there is a massive difference in resolution between different models. For symbols in my app, I will probably have to render at 12x and scale down by an  integer number. And even knowing that it's tricky figuring out where to position and how to crop assets.

 

True, but none of this negates the fact it's not easy or fast using complex vector images in Canvas, and near impossible in WebGL without rendering the data first. If you're building a truly vector art based game I would start experimenting with svg and forget all notions of using WebGL entirely.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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