RAUI-labs / raui

Rust implementation of Renderer Agnostic User Interface
https://raui-labs.github.io/raui/
Other
399 stars 10 forks source link

💡 Feature Idea — An SVG Widget Node #33

Closed zicklag closed 3 years ago

zicklag commented 3 years ago

I don't actually need this ( at least I probably won't anytime in the near future ), but I was thinking it could be very useful to have an SVG widget node. If I understand correctly, the only way people can get things like rounded borders or any shapes other than squares is to use images, but it could be very useful for making UIs with more style elements if you could render SVG.

It seems like it might not be too hard to hook up lyon to the tesselation renderer to do most of the work.

PsichiX commented 3 years ago

svgs should be done on an engine renderer side. i've done this in Oxygengine where i use svgs for UI images, i use svg file names in image boxes and engine renderer just applies svgs there. we could make it part of tesselate renderer but it has to be decoupled, and for that we would have to make image tesselation engine trait (same way as it is made for text tesselation engine), that will use svg tesselator as its plugin, not a core feature - the reason is to allow modularity, users might want to provide image tesselator from engines they use, just like they can do with texts.

zicklag commented 3 years ago

i use svg file names in image boxes and engine renderer just applies svgs there.

Oh, that's a good point. Maybe that makes this unnecessary. That's similar to how I'm doing text rendering anyway in Bevy Retro and it's no big deal.

we could make it part of tesselate renderer but it has to be decoupled, and for that we would have to make image tesselation engine trait (same way as it is made for text tesselation engine)

Yeah, that's a good idea.


Again, I don't actually need this, I was just thinking about how you might use RAUI for something like audio LV2 plugins, like the calf plugins use Cairo and SVG to make these awesome audio plugin UIs. Obviously there's a lot of art that goes into that, though. :)

image


I'll close this, because like you said it can just be done on the rendering side and that sounds good enough for pretty much anything.