mikke89 / RmlUi

RmlUi - The HTML/CSS User Interface library evolved
https://mikke89.github.io/RmlUiDoc/
MIT License
2.74k stars 299 forks source link

Fancy Clickable Shapes/Images/Buttons #549

Open SirNate0 opened 9 months ago

SirNate0 commented 9 months ago

Is there any way to do something like what is described here in RML? Basically, having polygonal and other non-rectangular clickable elements? Preferably with a way to mark when they are hovered as well, like changing the style. If not, are there any plans to make it work?

In HTML this can apparently be done with (see above link):

mikke89 commented 9 months ago

The short answer is no, not really.

However, in the effects branch of #307 there will be support for many rendering techniques that are applicable for the rendering part here, such as mask-image, and clipping contents of elements with border-radius. These won't affect the clickable region though.

I think implementing clip-path, or parts of it, is a very nice idea. Or maybe what we really want is an equivalent property that only affects clickable region but not rendering. To me, it makes more sense to implement this in CSS rather than the HTML-equivalent elements. And we probably also want to implement this: #534.