* refactor!(flutter): scaling with dpr on Rive Renderer * refactor(flutter)!: render object texture creation and paint * chore(editor): fix dragon login mouse follow * docs(flutter): update CHANGELOG * feat(flutter): apply transform scaling on RivePanel * chore(flutter): remove repaint boundary to fix goldens data bind artboards rcp file (#10214) c542b9b7ac * make file ref counted * migrate File to refcnt * add bindable artboard class to keep file reference * feat(unity): support rcp file and BindableArtboard class (#10228) * refactor(apple): use updated file bindable artboard apis (#10229) * update command queue to support bindable artboards * use bindable artboards on command queue * self manage view model instances in js runtime * change remaining viewModelInstanceRuntimes to rcp * refactor(apple): update view model instances to use rcp (#10298) * refactor(unity): support rcp ViewModelInstanceRuntime (#10309) * rebase fix * deprecate getArtboard in favor of getBindableArtboard * fix merge * remove unused lambda capture * fix rive binding * feat(Android): RCP File, VMI, and add bindable artboards (#10456) * refactor: C++ refactors - Import from long (incorrect) -> jlong - Header clang-tidy fix - Use reinterpret_cast instead of C-style cast - Break out some variables instead of long one liners - Use auto - Remove unused env and thisObj # Conflicts: # packages/runtime_android/kotlin/src/main/cpp/src/helpers/general.cpp * docs: Improve documentation on the File class * feat: Support bindable artboard type and RCP VMIs # Conflicts: # packages/runtime_android/kotlin/src/androidTest/java/app/rive/runtime/kotlin/core/RiveDataBindingTest.kt * feat: Support RCP files * refactor: Change from +1/-1 ref to just release * fix: Moved to the more appropriate null pointer for GetStringUTFChars * replace unref with release test: Add an android_gms_vulkan run to browserstack (#10669) f7613dbf35 Vulkan is ready to stabilize. Let's get it on our nightly runs. Also disable "atomic" mode on Android unless requested explicitly. Barriers tend to be expensive on Android and MSAA is usually cheap; let's stabilize MSAA first. fix(vk): Properly preserve render targets when using MSAA (#10630) 5df1a42463 * fix(vk): Properly preserve render targets when using MSAA Unfortunately, Vulkan does not provide a mechanism to initialize our (transient) MSAA texture with the contents of the (non-MSAA) renderTarget texture at the beginning of a render pass. To work around this limitation while supporting LoadAction::preserveRenderTarget, we literally draw the previous render target contents into the framebuffer at the beginning of the pass. * Fix one more barrier fix(vk, d3d12): Properly apply draw batch barriers on pipeline failures (#10667) 5efb71a88a If a pipeline failed to acquire for a draw batch that required barriers of any kind, we were skipping the barriers as well as attempting to draw. Now the code will apply the barriers and only skip drawing. chore: add pointer exit support (#10595) d999d6a22c * add pointer exit support scripting: color and string view model property (#10663) 3acbdfcba7 Description Adds support for passing a string and color vm property to the scripting engine. Adds support for defining color and string as inputs. feat: Integrate glfw into the premake build (#10656) 653c8c6040 Build GLFW with premake instead of requiring the user to call out into a custom script thatbuses their cmake. feat(scripting): split code panels (#10655) 9d8b49152e * feature(scripting): command palette * feature: adding split pane saving * chore: update to latest luau * fix: pixel correct scrollbars * feature: reload scroll position of script pane * feature: module titles on panes * chore: merging command palettes * fix: cleanup * chore: refactor searchbar tests * fix: failing test * chore: cleanup * chore: cleanup * chore: cleanup unused commented code * feature: hover for command palette items * chore: cleanup mocks Fix MSVC toolchain path_fiddle builds (#10661) 0f0d7c5f81 Our MSVC builds are building with C++latest (instead of C++17), and what that means is that filesystem::path::u8string returns a std::u8string instead of std::string (see https://en.cppreference.com/w/cpp/filesystem/path/string.html), causing a compilation failure for the shader hotload rebuild command. This change adds back in the reinterpret_cast to a char pointer (but still stores the temp string correctly). Add loop option to GM (#10649) 0121fd0174 * add loopCount * add static * Update gmmain.cpp * Change while to for Co-authored-by: Gordon <pggordonhayes@gmail.com>
Rive Flutter
Rive Flutter is a runtime library for Rive, a real-time interactive design tool.
This library allows you to fully control Rive files in your Flutter apps and games.
Table of contents
Overview of Rive
Rive combines an interactive design tool, a new stateful graphics format, a lightweight multi-platform runtime, and a blazing-fast vector renderer. This end-to-end pipeline guarantees that what you build in the Rive Editor is exactly what ships in your apps, games, and websites.
For more information, check out the following resources:
Getting started
To get started with Rive Flutter, check out the following resources:
For more information, see the Runtime sections of the Rive help documentation:
Choosing a Renderer
In Rive Flutter you have the option to choose either the Rive renderer, or the renderer that is used in Flutter (Skia or Impeller).
You choose a desired renderer when creating a Rive File object. All graphics that are then created from this File instance will use the selected renderer.
final riveFile = (await File.asset(
'assets/rewards.riv',
// Choose which renderer to use
riveFactory: Factory.rive,
))!;
Options:
Factory.rivefor the Rive rendererFactoy.flutterfor the Flutter renderer
For more information and additional consideration, see Specifying a Renderer.
Note on the Impeller renderer
Starting in Flutter v3.10, Impeller has replaced Skia to become the default renderer for apps on the iOS platform and may continue to be the default on future platforms over time. As such, there is a possibility of rendering and performance discrepencies when using the Rive Flutter runtime with platforms that use the Impeller renderer that may not have surfaced before. If you encounter any visual or performance errors at runtime compared to expected behavior in the Rive editor, we recommend trying the following steps to triage:
- Try running the Flutter app with the
--no-enable-impellerflag to use the Skia renderer. If the visual discrepancy does not show when using Skia, it may be a rendering bug on Impeller. However, before raising a bug with the Flutter team, try the second point below👇
flutter run --no-enable-impeller
- Try running the Flutter app on the latest master channel. It is possible that visual bugs may be resolved on the latest Flutter commits, but not yet released in the beta or stable channel.
- If you are still seeing visual discrepancies with just the Impeller renderer on the latest master branch, we recommend raising a detailed issue to the Flutter Github repo with a reproducible example, and other relevant details that can help the team debug any possible issues that may be present.
Supported platforms
| Platform | Flutter Renderer | Rive Renderer |
|---|---|---|
| iOS | ✅ | ✅ |
| Android | ✅ | ✅ |
| macOS | ✅ | ✅ |
| Windows | ✅ | ✅ |
| Linux | ❌ | ❌ |
| Web | ✅ | ✅ |
Be sure to read the platform specific considerations for the Rive Flutter package.
Awesome Rive
For even more examples and resources on using Rive at runtime or in other tools, checkout the awesome-rive repo.
Troubleshooting
The required native libraries should be automatically downloaded during the build step (flutter run or flutter build). If you encounter issues, try the following:
- Run
flutter clean - Run
flutter pub get - Run
flutter run
Alternatively, you can manually run the rive_native setup script. In the root of your Flutter app, execute:
dart run rive_native:setup --verbose --clean --platform macos
This will clean the rive_native setup and download the platform-specific libraries specified with the --platform flag. Refer to the Platform Support section above for details.
Building rive_native
By default, prebuilt native libraries are downloaded and used. If you prefer to build the libraries yourself, use the --build flag with the setup script:
flutter clean # Important
dart run rive_native:setup --verbose --clean --build --platform macos
Note
: Building the libraries requires specific tooling on your machine. Additional documentation will be provided soon.
Testing
Shared libraries are included in the download/build process. If you've done flutter run on the native platform, the libraries should already be available.
Otherwise, manually download the prebuilt libraries by doing:
dart run rive_native:setup --verbose --clean --platform macos
Specify the desired --platform, options are macos, windows, and linux.
Now you can run flutter test.
Optionally build the libraries if desired:
dart run rive_native:setup --verbose --clean --build --platform macos
If you encounter issues using rive_native in your tests, please reach out to us for assistance.
Contributing
We love contributions and all are welcome! 💙
Issues
- Reach out to us on our Community
- File an issue on the Rive Flutter repository
Rive Flutter Legacy Runtime
You can find the old runtime code here: https://github.com/rive-app/rive-flutter-legacy
The last published Pub release for this code is rive: 0.13.20.
The majority of the new runtime code now lives in the rive_native package.
