Skip to content

Commit

Permalink
feat: Re-export rive_rs (#9)
Browse files Browse the repository at this point in the history
# Problem

Those who pull in rive-bevy shouldn't need to pull in rive-rs. By
re-exporting the version of rive-rs, users following the example won't
face issues and, for maintainability, the end-user doesn't need to
ensure versions match.

# Solution

- Re-export rive_rs
- Examples now use `rive_bevy::rive_rs:_` instead of `rive_rs::_`
imports
  • Loading branch information
simbleau authored Dec 4, 2023
1 parent 0107c41 commit 378cef7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions examples/rive-events.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
//! An example showcasing how to receive events from a Rive state machine.

use bevy::{prelude::*, render::render_resource::Extent3d, window};
use rive_bevy::{GenericEvent, RivePlugin, SceneTarget, SpriteEntity, StateMachine};
use rive_rs::state_machine::Property;
use rive_bevy::{
rive_rs::state_machine::Property, GenericEvent, RivePlugin, SceneTarget, SpriteEntity,
StateMachine,
};

fn main() {
App::new()
Expand Down
2 changes: 1 addition & 1 deletion examples/rive-input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
use bevy::{prelude::*, render::render_resource::Extent3d, window};
use rive_bevy::{
events::{self, InputValue},
rive_rs::components::TextValueRun,
RivePlugin, RiveStateMachine, SceneTarget, SpriteEntity, StateMachine,
};
use rive_rs::components::TextValueRun;

const BACKGROUND_COLOR: Color = Color::rgb(0.0, 0.0, 0.0);

Expand Down
4 changes: 2 additions & 2 deletions examples/shmup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use bevy::{
use rand::prelude::*;

use rive_bevy::{
events, Riv, RivePlugin, RiveStateMachine, SceneTarget, SpriteEntity, StateMachine,
events, rive_rs::scene::Scene, Riv, RivePlugin, RiveStateMachine, SceneTarget, SpriteEntity,
StateMachine,
};
use rive_rs::scene::Scene;

// const BACKGROUND_COLOR: Color = Color::rgb(0.0, 0.0, 0.0);
const BACKGROUND_COLOR: Color = Color::rgb(0.023, 0.0, 0.102);
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ mod node;
mod plugin;
mod pointer_events;

// Re-export rive-rs
pub use rive_rs;

pub use crate::{
assets::Riv,
components::{
Expand All @@ -13,5 +16,5 @@ pub use crate::{
},
events::GenericEvent,
plugin::RivePlugin,
rive_rs::Handle,
};
pub use rive_rs::Handle;

0 comments on commit 378cef7

Please sign in to comment.