Skip to content

Latest commit

 

History

History
82 lines (52 loc) · 2.43 KB

README.md

File metadata and controls

82 lines (52 loc) · 2.43 KB

TextBlockFX_Logo_Large

TextBlockFX

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.

SOURCE

https://github.com/validvoid/TextBlockFX

MP4

Untitled.mp4

Get Started

Install

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

Usage

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>

Built-in Effects

  • Default
  • Motion Blur
  • Blur

Supported Features

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.

Write Your Own Effect

  • 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.