2D image on the canvas + screenshot download

Hi.

First of all, congrats on the new release, I am really excited about so many new stuff, can’t wait to start playing with them. When I first started working with 3D on the web, after many hours of research I’ve decided to go with Babylon.js, mostly because I saw what a great community it has, and to this day I am promoting and believing that Babylon is and will be the best engine out there. And I believe this new release is once again proving that I chose it right.

Now, my question. I have an app that have feature to download a screenshot of the canvas (PNG). I would like to add a logo on the screen (2d image), and I would like to include that image in the screenshot download.

I know that I can use Babylon GUI to draw that image, but it’s drawn on separate canvas as I believe. Also, I have some ideas, but they seem complex to me, and I am interested if there is some easy, obvious solution to do this.

As you can see on Image, I have babylon scene drawn on the canvas. I want to add that logo on top, and when I use screenshot feature, I want to get both Babylon scene (model in the scene), and the logo on the downloaded PNG.

Thanks

I’ve figured it out. I’ve drawn logo on the advancedTexture and I’ve switched from CreateScreenshotUsingRenderTarget to CreateScreenshot function, and it captures both logo and model in the image.

image

image

3 Likes