excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.82k stars 188 forks source link

Add SVG image support to Texture for Drawables #1038

Closed eonarheim closed 2 years ago

eonarheim commented 6 years ago

Context

Currently, only bmp, jpg, and png image types are support in excalibur texture system. Raster graphics have a few downsides, notably their potentially size and problems scaling up.

SVG would allow for infinite scaling, and super small image sources to download

Proposal

Implement SVG as a supported Texture type,


let svgTex = new ex.Texture('./path/to/my/cool.svg');

Some materials to reference:

kevin192291 commented 5 years ago

I was just working in the Texture class. Mind if I pick this one up?

eonarheim commented 5 years ago

@kevin192291 Go for it!

eonarheim commented 2 years ago

SVG's are now supported accidentally in ex.ImageSource in the webgl renderer!

image

kevin192291 commented 2 years ago

Is this still an issue? Want me to have a look at it?