Lottie-Windows is a library (and related tools) for rendering Lottie animations on Windows 10.
Перейти к файлу
Geoffrey Trousdale 10d8542b15 Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
.config Updated Cake build system to newer version, and updated source to net7.0. (#530) 2023-04-18 22:59:16 -07:00
.github Remove individual code owners and replace with the Lottie group. (#257) 2020-05-13 09:18:46 -07:00
Lottie-Windows Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
LottieGen Moved Lottie Island project files over to this repo 2024-03-15 13:17:43 -04:00
LottieIsland Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
LottieIslandProjection Add C# app and show how to consume nuget packages. (Only working in C#, packages not set up correctly for native yet) 2024-04-20 17:50:47 -04:00
LottieSamples Csproj Refactoring (#504) 2022-05-26 14:24:59 -07:00
LottieViewer Updated Cake build system to newer version, and updated source to net7.0. (#530) 2023-04-18 22:59:16 -07:00
LottieWinRT Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
SimpleLottieIslandApp Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
build Reduced CsWinRT issue down to simpler form, added logic to build scripts to build new projects 2024-04-18 16:43:47 -04:00
dlls Updated Cake build system to newer version, and updated source to net7.0. (#530) 2023-04-18 22:59:16 -07:00
images README Updates (#65) 2019-02-19 11:27:27 -08:00
source Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
tests Fix some missing simplifications in Composition expressions. (#429) 2021-03-05 14:05:00 -08:00
.gitattributes Initial commit of Lottie-Windows source. 2018-11-21 12:18:46 -08:00
.gitignore Removed unused projects, moved LottieWinRT over to custom interface 2024-04-18 12:58:23 -04:00
Directory.Build.props Fixed AssemblyFileVersion attribute (#546) 2024-02-26 11:42:39 -08:00
Directory.Build.targets Fixed assembly version (#545) 2024-02-23 14:19:01 -08:00
LICENSE.md Change capitalization of the LICENSE.md file to help GitHub recognize it. 2018-11-23 23:18:18 -08:00
Lottie-Windows.sln Remove C# sample app, change LottieIsland to take an AnimatedVisual 2024-04-24 15:33:41 -04:00
README.md Added quickstart to readme, fixed build status section (#550) 2024-02-27 13:27:57 -08:00
Toolkit.ruleset Prepare for gradients (#143) 2019-08-29 10:03:44 -07:00
VERSION_HISTORY.md Merge the v6.1.0 release to master and start v7.0.0 (#292) 2020-06-15 12:56:22 -07:00
azure-pipelines.yml Updated Cake build system to newer version, and updated source to net7.0. (#530) 2023-04-18 22:59:16 -07:00
global.json Updated Cake build system to newer version, and updated source to net7.0. (#530) 2023-04-18 22:59:16 -07:00
settings.xamlstyler Fixed typos in settings.xamlstyler (#481) 2022-01-11 12:49:42 -08:00
stylecop.json Initial commit of Lottie-Windows source. 2018-11-21 12:18:46 -08:00
toolkit.public.snk Initial commit of Lottie-Windows source. 2018-11-21 12:18:46 -08:00
toolkit.snk Initial commit of Lottie-Windows source. 2018-11-21 12:18:46 -08:00
version.json Worked through threading issues from using C# events 2024-04-19 00:47:14 -04:00

README.md

Lottie-Windows

Lottie-Windows is a library for rendering Adobe After Effects animations natively in your application. This project adds Windows to the Lottie family of tools also targeting Android, iOS, and Web.

Lottie simplifies the design-to-code workflow for bringing engaging, interactive vector animations to your Windows applications, with significant improvements in terms of performance, quality, and engineering efficiency over traditional approaches such as gifs, manually coded animations, etc. Lottie-Windows uses the Windows.UI.Composition APIs to provide smooth 60fps animations and resolution-independent vector graphics.

Lottie-Windows Gif

Lottie-Windows consists of 3 related products:

  • Lottie-Windows library for parsing and translating Bodymovin JSON files
  • LottieGen command-line tool for generating C# or C++ code to be used instead of JSON
  • Lottie Viewer application for previewing JSON and also generating code

This repo also contains source code for samples.

Quick start

There are two options to integrate Lottie animations into your WinUI 3 or UWP project.

Option #1, using dynamic loader

  1. Install CommunityToolkit.WinUI.Lottie nuget package for WinUI project (or CommunityToolkit.Uwp.Lottie for UWP project).
  2. If you are using C# you may also need to install Microsoft.Graphics.Win2D (version 1.0.5 or below) for WinUI project (or Win2D.uwp and Microsoft.UI.Xaml for UWP project).
  3. In your .xaml markup file add:
        ...
        xmlns:lottie="using:CommunityToolkit.WinUI.Lottie"
        ...
        <AnimatedVisualPlayer>
            <lottie:LottieVisualSource UriSource="<asset path or web link to a json file>" />
        </AnimatedVisualPlayer>
    
    or for UWP project:
        ...
        xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
        xmlns:lottie="using:CommunityToolkit.Uwp.Lottie"
        ...
        <muxc:AnimatedVisualPlayer>
            <lottie:LottieVisualSource UriSource="<asset path or web link to a json file>" />
        </muxc:AnimatedVisualPlayer>
    

Option #2, using codegen (recommended)

  1. Install codegen tool using dotnet tool install lottiegen in powershell
  2. Run codegen tool lottiegen -InputFile MyAnimation.json -Language cs -WinUIVersion 3
    • For UWP projects use -WinUIVersion 2.X depending on the version of Microsoft.UI.Xaml
    • Other language options: cppwinrt and cppcx
  3. Add generated source files to the project
  4. Install packages from step 2 of Option #1 if needed.
  5. In your .xaml markup file add:
        ...
        xmlns:animatedvisuals="using:AnimatedVisuals"
        ...
        <AnimatedVisualPlayer>
            <animatedvisuals:MyAnimation/>
        </AnimatedVisualPlayer>
    
    or for UWP project:
        ...
        xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
        xmlns:animatedvisuals="using:AnimatedVisuals"
        ...
        <muxc:AnimatedVisualPlayer>
            <animatedvisuals:MyAnimation/>
        </muxc:AnimatedVisualPlayer>
    

Supported SDKs

  • May 2019 Update (18362) and later

Documentation

Build Status

Package Branch Status Latest nuget version
CommunityToolkit.WinUI.Lottie main Build Status NuGet
CommunityToolkit.Uwp.Lottie main Build Status NuGet
LottieGen main Build Status NuGet

Feedback and Requests

Please use GitHub Issues for bug reports and feature requests.

Principles

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.