bevy_scroller 0.1.0

Scroller plugin for Bevy
Documentation

bevy_scroller

Bevy plugin to scroll things. It allow to write generators with custom logic for item generation You can also create parallaxes with it.

Features

  1. Change scroll direction
  2. Support dfferent scroll item sizes
  3. Render to texture
  4. Pre-build generators:
    1. Single - repeat single image
    2. Sequence - repeat sequence of iamge
    3. Random Sequence - scroller will consist of random iamge from sequence
    4. Custom generators - set up your own system to generate scroller items. With this, you can scroll not only images but anything

Usage

spawn a scroller-entity with:

  1. ScrollerSize component
  2. Scroller component
  3. If you want any of pre-build generators, attach ScrollerGenerator component
  commands.spawn((
    ScrollerGenerator::SpriteSingle("scroller_image.png".into()),
    ScrollerSize {
      size: Vec2::new(500., 300.),
    },
    ScrollerBundle {
      scroller: Scroller {
        speed: 1.,
        direction: ScrollerDirection::Forward,
        ..default()
      },
      ..default()
    },
  ));

Examples

example image description
single shows a basic usage
sequence shows a usage of sequence generator
random_sequence shows random sequence generator
multiple example of muptiple scrollers
mirrors parallax example of how you can render scroller to texture and then use that texture to show this same scroller in other parts of applications
parallax parallax showing how you can set up a parallax with this plugin

Credits