25 Commits

Author SHA1 Message Date
672dbf976e Add support to Listeners for events from nested artboards
- Propagate events up to parent Artboard state machines
- Add Event to Listener types and display in combobox
- Add support for StateMachineListeners to listen for events

Still needs implementation on CPP runtime.

In this example, the rectangles are in a nested artboard. Clicking them fires an event from the nested artboard up to the parent artboard which has a listener which updates an input triggering the animation.

https://github.com/rive-app/rive/assets/186340/22bfb00e-8d1e-46f0-8faa-d2d5e5a1bbfb

Diffs=
1a9dd7e97 Add support to Listeners for events from nested artboards (#5923)
52a1a6f88 Added a Rust runtime. (#6027)
22077beda feat: add count and query APIs for events and text runs at the Artboard level, and expose in WASM (#6043)
f95f54140 Add out of band loading to rive-wasm (#6017)
54d736fec 6041 follow path with 0 opacity (#6060)
bb7d5ac4c Add a math::round_up_to_multiple_of<N>() utility (#6061)
6ee7cea9e Clamping color stops. (#6052)
bb00ec119 Add a WebGPU mode that uses EXT_shader_pixel_local_storage (#6048)
af873d55a update runtime with file asset cdn information (#6040)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
2023-10-11 21:22:17 +00:00
98040494a8 feat: expose wrapper event class to runtime
The goal of this PR is to improve the usability of events for the Flutter runtime and to hide unnecessary editor implementation detail. This also ensures that an event is not modifiable after it has been reported (from the runtime's perspective)

This is achieved by exposing runtime specific classes `RiveEvent`, `RiveOpenURLEvent` and `RiveGeneralEvent` (similar to the other runtimes), and mapping the current `Event` to these classes as an immutable object. It also maps the list of events to a Map called `properties`.

This PR also:
- Adds more event examples and fixes the audio example (`.stop` resulted in issues, and calling dispose, etc.)
- Adds tests for events

TODO:
- Will need to potentially change things (and expose the `delay`) when this lands: https://github.com/rive-app/rive/pull/5951

Diffs=
eae01824d feat: expose wrapper event class to runtime (#5956)

Co-authored-by: Gordon <pggordonhayes@gmail.com>
2023-09-18 17:54:53 +00:00
9e7a831df6 Make TextValueRun visible to clients and NestedArtboards too.
Makes this easier:
```
class MyController extends RiveAnimationController<Artboard> {
  @override
  bool init(Artboard core) {
    var run = core.component<TextValueRun>("blah");
    run?.text = "HEEEEEY";

    return super.init(core);
  }

  @override
  void apply(Artboard? core, double elapsedSeconds) {}
}
```

Also exposes NestedArtboard which lots of users have requested.

Diffs=
fa36ec055 Make TextValueRun visible to clients and NestedArtboards too. (#5657)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
2023-07-24 21:27:49 +00:00
0e3fdf8de5 Caching example
(basing this pr onto our dart runtime change for now, to limit scope)

made some small tweaks to function names, mostly to get fonts and images to "feel" more similar.

broke out "decode' into parsing the asset first.

makes it possible to cache images/fonts with our dart runtime, example included

Diffs=
40302069e Caching example (#5517)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-06 10:50:13 +00:00
5def5d7b1c Font dart runtime
There are a number of questions I'd like to resolve before considering to merge this. also a few thigns to clean up no doubt

# Questions before merging
To customize loading out of band assets, we expect our users to implement
```
abstract class FileAssetLoader {
  Future<bool> load(FileAsset asset);
  bool isCompatible(FileAsset asset) => true;
}
```

1. is this a good interface (i've changed `loadContents`, to `load`)? (if we like this we should change this in cpp too)
2. `FileAssetLoader` is a mouth-full, would `AssetLoader` be better?
3. We are passing `FileAssets` (our core objects) to users with some slight api extensions, is that good? should we just wrap this in an Asset class (I had this before, its not a lot of work to get it back)

things sorted
- [x] cdn "loading" vs url loading
    - just sticking with cdn, users can customize for url
- [x] asset class for consumers of our runtime.
    - i've avoided this one for now, just extending our FileAsset
- [x] Importer/Resolver/Loader. I flipped some names around, mostly because I want our end users to provide an `AssetLoader`, not a resolver.

things to sort out down the line, i'm declaring them out of scope for this pr, fft disagree:
- Fallback font, I see we have a fallback font file hardcoded in the runtime. should investigate if we can include an asset for people like this, or if we need to have users set this if they want to use fallback fonts.
- Image Placement, we should strip width/height from runtimes on ImageAssets
- What do we want to do about asset loading / decoding errors
- TextStyle has both assetId & fontAssetId it gets assetId from the file asset referencer, its nbd,

Diffs=
06e959ad2 Font dart runtime (#5411)

Co-authored-by: Maxwell Talbot <talbot.maxwell@gmail.com>
2023-07-06 08:49:14 +00:00
cac78883af Value Graph Export + Runtime Support!!
- Renamed CubicInterpolator to CubicEaseInterpolator so that CubicInterpolator can now be the base class for both CubicEaseInterpolator and CubicValueInterpolator.
- Added CubicValueInterpolator to cpp and Flutter runtimes.
- Test in cpp runtime for the new cubic value interpolation.

Diffs=
1e80ad08f Value Graph Export + Runtime Support!! (#4524)
c532f8658 Shorten harfbuzz/SheenBidi directory paths
312a6c778 Drop the runtime to C++11
de4fe4d71 export MAKE_SKIA_FILE from all top-level scripts that build Skia
75a6b74b8 Beef up testing in tools/*
79f98695a Don't show interactive download progress when premaking on bots
b7fd1d825 Move golden testing into tools/
2022-12-14 22:15:43 +00:00
f721bbdee8 Expose format error exception and don't always advance nested artboards. 2021-10-14 21:03:39 -07:00
890e3edae9 Adding rive_scene 2021-10-14 11:57:09 -07:00
efdd943f39 Ran generator for constraints. 2021-07-13 17:41:43 -07:00
794bb90147 Adds artboard parameter to onInit callback 2021-06-18 11:02:53 -07:00
dddb78b62f Adds one-shot animation controller 2021-06-14 14:41:10 -07:00
f3f483650f Fixes exports and adds tests 2021-06-14 13:14:48 -07:00
7d82d06c79 WIP on simplifying controller use 2021-06-11 18:45:57 -07:00
1d54191031 Adds high level RiveAnimation widget 2021-05-27 17:37:54 -07:00
33ad1c9ac8 Working on nnbd. 2021-03-22 14:49:42 -07:00
462faf20ff Adding ability to control state machine. 2021-03-11 20:21:35 -08:00
1cdaaae870 Adds animationByName method to Artboard and more tests 2020-11-17 11:54:58 -08:00
2e4a8ace85 Fixes #15 and preps for publish. 2020-10-02 15:56:43 -07:00
128b6b9770 export loop as part of the package 2020-09-30 19:06:44 +01:00
a2c9178bfc Improving controllers so they can mix animations more easily. 2020-07-17 15:30:23 -07:00
1c9035d64b Exposing more internal components. 2020-07-17 11:45:18 -07:00
c9f0a9afdd Fix Pub analysis 2020-07-09 09:09:31 +00:00
d31388d6e4 Initial checkin of Rive 2 runtime. 2020-07-08 16:36:55 -07:00
f1817858bf Murder. 2020-07-08 16:13:04 -07:00
2235515471 First commit 2019-12-02 18:51:52 -08:00