bevy_scrollmat

Crates.iobevy_scrollmat
lib.rsbevy_scrollmat
version0.1.0
created_at2025-06-04 15:10:32.8957+00
updated_at2025-06-04 15:10:32.8957+00
descriptionA simple Extension Material that applies a scrolling effect to the uvs of the material.
homepage
repositoryhttps://github.com/Pybounce/bevy_scrollmat
max_upload_size
id1700543
size137,946
(Pybounce)

documentation

README

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
Commit count: 15

cargo fmt