1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-13 09:08:34 +00:00

Updated Implementing an own brush (markdown)

DarthAffe 2017-01-15 12:12:25 +01:00
parent bd946b325b
commit a91a0257d3

@ -9,7 +9,7 @@ Starting here, there are two ways to create your own logic.
### The simple way ### The simple way
This should be the preferred way for almost every case since it's possible to achieve nearly everything without much effort. Every basic-brush shipped with CUE.NET is implemented this way. This should be the preferred way for almost every case since it's possible to achieve nearly everything without much effort. Every basic-brush shipped with CUE.NET is implemented this way.
You start by simply deriving from _[AbstractBrush](https://github.com/DarthAffe/CUE.NET/blob/master/Brushes/AbstractBrush.cs)_ and implementing the _GetColorAtPoint_-Method which should contain the logic your brush needs to decide which color goes where. You start by simply deriving from _[AbstractBrush](https://github.com/DarthAffe/CUE.NET/blob/master/Brushes/AbstractBrush.cs)_ and implement the _GetColorAtPoint_-Method which should contain the logic your brush needs to decide which color goes where.
The easiest example here is the _[SolidColorBrush](https://github.com/DarthAffe/CUE.NET/blob/master/Brushes/SolidColorBrush.cs)_. It stores a color-property containing the color which is simply returned on every call to _GetColorAtPoint_, coloring the whole region in a single color. The easiest example here is the _[SolidColorBrush](https://github.com/DarthAffe/CUE.NET/blob/master/Brushes/SolidColorBrush.cs)_. It stores a color-property containing the color which is simply returned on every call to _GetColorAtPoint_, coloring the whole region in a single color.
```c# ```c#
public class SolidColorBrush : AbstractBrush public class SolidColorBrush : AbstractBrush