bevy_scrollmat 0.1.0

A simple Extension Material that applies a scrolling effect to the uvs of the material.
Documentation
  • Coverage
  • 14.29%
    1 out of 7 items documented0 out of 3 items with examples
  • Size
  • Source code size: 137.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.29 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2m 58s Average build duration of successful builds.
  • all releases: 2m 58s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Pybounce/bevy_scrollmat
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Pybounce

bevy_scrollmat

Latest version

A simple Extension Material that applies a scrolling effect to the uvs of the material.

Usage


    fn main() {
        // add the ScrollMatPlugin to your app.
        App::new()
            .add_plugins((
                DefaultPlugins,
                ScrollMatPlugin,
        )).run();
    }
    // function that spawns a new shape with a scrolling material
    // note that the object below has no texture so scrolling won't be visible. For an example, check the examples directory
    fn spawn_scrolling_shape(
        mut commands: Commands,
        mut scroll_mats: ResMut<Assets<ExtendedMaterial<StandardMaterial, ScrollMatExtension>>>,
    ) {
        let handle = scroll_mats.add(
        ExtendedMaterial {
            base: StandardMaterial {
                // any changes to material you'd like here
                ..default()
                },
                extension: ScrollMatExtension { // add the scroll mat extension
                    scroll_speed: Vec2::Y   // sets the scroll speed to (0, 1) per second
                }
            }
        );
        commands.spawn((
            Mesh3d(mesh_handle),    // mesh_handle defined elsewhere to keep things simple
            MeshMaterial3d(handle),
            Transform::default(),
        ));
    }

Compatibility

Bevy version bevy_scrollmat version
0.16 0.1