Babylonjs gui svg icon id support

Hi, so my request actually stemmed from the last question in this post (detectPointerOnOpaqueOnly for gui image only buttons). Turns out, I’m going to need many icons. Many meaning > 100. And manually defining sourceLeft/sourceTop, icon size width/height definitions isn’t really efficient for batch loading of svg assets. Ideally, I’d like to use the icon id, ala spritesheet.svg#icon or spritesheet.svg#home for fast simple autoloading.

So asking if there’s any chance to add an options to the gui image controls constructors for loading via icon id for svg assets? Primary benefit: speed up svg UI artist workflow. Thoughts ?

Absolutely fine with the idea. Do you want to try submitting a PR?

Um, up to my neck making assets. If no one takes it in Sept., I can prolly take it. Thanks for the green light !

edit: need getBBox or getBoundingClientRect ?

2 Likes