A TextBlock control which animates the text with customizable effects.
TextBlockFx generates difference results for attached effect to animate the text when its content changes by using its built-in diffing algorithm.
https://github.com/validvoid/TextBlockFX
Untitled.mp4
In Solution Explorer panel, right click on your project name and select Manage NuGet Packages. Search for TextBlockFX.Win2D.UWP
then click install to install the package.
Or enter the following command in Package Manager Console to install it:
Install-Package TextBlockFX.Win2D.UWP -Version 1.0.3
In your XAML page, add a reference at the top of your page:
xmlns:tbfx="using:TextBlockFX.Win2D.UWP"
xmlns:effects="using:TextBlockFX.Win2D.UWP.Effects"
Then add TextBlockFX to your page:
<tbfx:TextBlockFX Text="Your text here">
<tbfx:TextBlockFX.TextEffect>
<effects:Default/>
</tbfx:TextBlockFX.TextEffect>
</tbfx:TextBlockFX>
- Default
- Motion Blur
- Blur
Feature | UWP(Win2D) | WinUI3(Win2D) |
---|---|---|
FontFamily | ✅ | 🚧 |
FontSize | ✅ | 🚧 |
FontStretch | ✅ | 🚧 |
FontStyle | ✅ | 🚧 |
FontWeight | ✅ | 🚧 |
TextAlignment | ✅ | 🚧 |
TextDirection | ✅ | 🚧 |
TextTrimming | ✅ | 🚧 |
TextWrapping | ✅ | 🚧 |
✅: Supported
🚧: WIP
TextBlockFX only support UWP projects for now. WinUI3 support and Skiasharp based implementation for other platform targets are WIP.
- Define a new effect class and implement the
ITextEffectAnimated
for CanvasAnimationControl (USED GPU),ITextEffect
for CanvasControl (NORMAL MEMORY) interface. - Draw the text by using Win2D API.