diff --git a/site/blog/2024-12-13-excalibur-0-30-0-released/2024-12-13-excalibur-0-30-0-released.md b/site/blog/2024-12-13-excalibur-0-30-0-released/2024-12-13-excalibur-0-30-0-released.md index c6369f381..795894ce3 100644 --- a/site/blog/2024-12-13-excalibur-0-30-0-released/2024-12-13-excalibur-0-30-0-released.md +++ b/site/blog/2024-12-13-excalibur-0-30-0-released/2024-12-13-excalibur-0-30-0-released.md @@ -187,6 +187,36 @@ Check out the [full release notes](https://github.com/excaliburjs/Excalibur/rele ### ImageSource from SVG and Canvas +You can now source images from SVG literal strings, SVG files, and HTML Canvas elements! This increases the flexibility of images that you can use to make your games. Plus SVG and Canvas rock 🤘 + +```typescript +const svgExternal = new ex.ImageSource('../images/arrows.svg'); +const svg = (tags: TemplateStringsArray) => tags[0]; + +const svgImage = ex.ImageSource.fromSvgString(svg` + + + +`); + +const myCanvas = document.createElement('canvas')!; +myCanvas.width = 100; +myCanvas.height = 100; +const ctx = myCanvas.getContext('2d')!; +ctx.fillStyle = ex.Color.Black.toRGBA(); +ctx.fillRect(20, 20, 50, 50); + +const canvasImage = ex.ImageSource.fromHtmlCanvasElement(myCanvas); +``` ### GPU Particles @@ -400,7 +430,9 @@ Excalibur now watches for textures that have not been drawn in 60 seconds and un ## Caliburn Games -The Excalibur.js contributors are offering consulting services! You can hire us to do game dev, custom dev, or support! If you're interested check out our current list of products https://caliburn.games/products/ +The Excalibur.js contributors are offering consulting services! You can hire us to do game dev, custom dev, or support! If you're interested check out our current list of products https://caliburn.games/products/ + +Caliburn Games' goal is to build friendly games in TypeScript and support the Excalibur.js community and open source project. ## The Glorious Future