Leverage Skia Context outside of the GUI #4
-
I was hoping to leverage the skia context provided by this library outside of a render-pass to generate at runtime sprites of varying detail depending on the user's settings, or perhaps to use the skia context to render vector geometry in interesting ways at runtime (like for warning indicator hitbox hints or similar) Looking at the API surface, is that possible? How difficult would it be to have Godot entities that draw themselves using a skia API? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You can get access to Skia's You can also leverage Avalonia's geometry support without using Skia directly: use any That said, your use case seems very specific and probably not what Estragonia was made for: if you have no interest in Avalonia's capabilities and only want to use Skia, it might be easier to create a Skia surface directly from a Godot texture (Vulkan image). You can use GodotVkSkiaGpu to get started. I'm converting this issue to a discussion. |
Beta Was this translation helpful? Give feedback.
-
I'm having great success with Estragonia as the Gui layer. Feels so good to leverage my WPF/Avalonia experience to design a game's GUI. I was looking at the custom drawing operations Godot offers and finding myself disappointed, thinking, if only there was a way to get GPU accelerated skia into there. Then, whilst perusing your code to see how things were put together, I had seen that you had already done this, and thought "wow", hence the discussion. I'll try out your suggestion. Thanks much. 😄 |
Beta Was this translation helpful? Give feedback.
-
Happy to report back that your classes are very well designed and integrating them was a breeze. Many thanks for your help, and this fantastic library. 👍 Using MSFT SkiaSharp Tutorial as an example test skia drawing routine. |
Beta Was this translation helpful? Give feedback.
You can get access to Skia's
SkCanvas
for a given Avalonia control by using aICustomDrawOperation
: see Avalonia's Custom Skia Page sample.You can also leverage Avalonia's geometry support without using Skia directly: use any
Shape
-derived control, such asPath
, or overrideRender
and use the variousDrawX
methods to render your geometry.That said, your use case seems very specific and probably not what Estragonia was made for: if you have no interest in Avalonia's capabilities and only want to use Skia, it might be easier to create a Skia surface directly from a Godot texture (Vulkan image). You can use GodotVkSkiaGpu to get started.
I'm converting this issue to a discussion.