The material of a GUI element

Maybe I’ve overlooked, but it looks like the 2D GUI library creates HTML elements instead of elements inside the canvas. With that, I don’t think it’s possible to use materials with specific UI elements.

Is there a way to use this in another way to use materials with specific parts of the UI? I’m not talking about the material of the AdvancedDynamicTexture on which the UI is shown.

GUI control and containers are not HTML objects but are elements of a canvas. They are not meshes so cannot have materials applied. Are you talking about using images Use the Babylon GUI - Babylon.js Documentation ?

Perhaps you could produce an image to show what you want your UI to look like.

Thanks for your response, I’m basically talking from a Unity3D perspective where elements can have materials. Which would mean you could animate them based on shader logic. So let’s say I want to make a button burn like a piece of paper. But I guess this would be to much at the moment.

If you need that the easiest is to create 2 camera with one orthographic one and create planes or meshes with materials. I agree it is less convenient but might be the easiest for special effects on your gui.

You can animate GUI Images as in

Perhaps there is a possibility here either by overlaying a simple button or using a center image button


button.thickness = 0;

to remove border