Page 1 of 1
Custom graphics, learning NoesisGUI
Posted: 15 Jun 2023, 05:03
by mshvern23
I'm rendering a lot of BezierSegment elements and I want to add a new feature to the control's graphics: being able to draw "borders" along either side of the BezierSegment (so I'd need to calculate an arbitrary number of bezier curves), and an ability to tile a texture that aligns with curve.
I'm working with Unreal.
What are my options to implement something ilke this? Are there any examples with Noesis and C++ that I can find?
And, more broadly, is there a comprehensive guide on working with NoesisGUI and WPF using C++ or is my best bet reading through WPF Unleashed and translating C# to C++ as I go?
Re: Custom graphics, learning NoesisGUI
Posted: 16 Jun 2023, 19:39
by jsantos
I assume you already read all our C++ and Common tutorials?
https://www.noesisengine.com/docs/
We have support for
Custom render that maybe useful in this scenario but I am going to need more detail about what you want to achieve to give you more specific help.
Re: Custom graphics, learning NoesisGUI
Posted: 17 Jun 2023, 06:48
by mshvern23
Thanks for your response. I have read through all of the docs, yes. I will do so again, but I don't remember there being an example of anything like what I'm trying to do.
I want to achieve two things:
1. Similarly to how there's stroke dash array for BezierSegment to control dashes along the direction of the curve, I'd like to have the same effect but on the perpendicular axis. See this for reference:
2. Align a fill allong the curve, similarly to how you'd do it in 3D:
Custom render sample does look promising but would lock me into something hard to control from XAML (e.g. if I want to use the nice Path Trim feature NoesisGUI implements, I have to do it all in code instead of just launching a simple storyboard).
Re: Custom graphics, learning NoesisGUI
Posted: 20 Jun 2023, 19:49
by sfernandez
1. This can be achieved with a custom control that exposes a BezierSegment property and calculates the required beziers for the borders. Then it uses OnRender to draw all the beziers with the appropriate stroke sizes.
2. I don't know if something like this could be achieved using a
BrushShader, but is the only way you can have full control of what is rendered inside a path.