Giter Club home page Giter Club logo

bevy_splash_screen's Introduction

EN | ES


SergioRibera Web SergioRibera LinkedIn SergioRibera Twitter SergioRibera Youtube


⚙️ Things I use to get stuff done

  • SO: NixOs
  • WM/DE: hyprland && rofi for more pleasure
  • Terminal: Wezterm, my configuration
  • Shell: Fish, yeah pure fish. If you want to see my configuration, see here
  • Code Editor: Neovim, the best in the world, I put my config here
  • My favorite technologies: rust, typescript, bun, rust, reactjs, docker, python, c#, rust and rust

Note: for more pleasure I use Neovim with neovide

Checkout my system configuration on here

Awesome Projects 📚

💻 Project Name 🌟 Stars 🍴 Forks 🐛 Issues 🔔 Pull Requests 👨‍💻 Top Language
Sbbw Stars Forks Issues Pull Requests Language
Vim Screenshot Stars Forks Issues Pull Requests Language
Vim Files Stars Forks Issues Pull Requests Language
Neovim Config Plugin Stars Forks Issues Pull Requests Language
Plymouth Theme Stars Forks Issues Pull Requests Language
Lightdm Theme Stars Forks Issues Pull Requests Language
Crkbd Desktop Stars Forks Issues Pull Requests Language
Archlinux Sarosi Config Stars Forks Issues Pull Requests Language
My ST Fork Boosted Stars Forks Issues Pull Requests Language
PvZ Clone Stars Forks Issues Pull Requests Language
c++ Console Game Stars Forks Issues Pull Requests Language
Happy New Year Stars Forks Issues Pull Requests Language
Christmas Tree Stars Forks Issues Pull Requests Language
Simple MVC System Stars Forks Issues Pull Requests Language
404 Dot Style Stars Forks Issues Pull Requests Language
404 Linux Style Stars Forks Issues Pull Requests Language

Show some ❤️ by starring some of the repositories!

This readme is autogenerate with github actions

bevy_splash_screen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bevy_splash_screen's Issues

Allow static brands

The idea is to achieve something like the example image but that can have its own tween animations based on the total animation or relative by brand

ezgif com-gif-maker

Only skip one SplashScreen at a time

Current behavior

When clicking to skip the splash screen it skips all the the splash screens at once if multiple splash screens are chained

Expected behavior

When clicking, it only skips the current splash screen. If there is a second splash screen, a second click is needed.
That's how it's implement in most video games.

Compiling examples on linux

I have cloned the repo locally on my linux computer and I could not compile the examples, while building the dependencies, winit complained that it couldn't compile winit for my platform.

Following djeedai/bevy_hanabi#170, I have changed default-features = true for bevy in the cargo.toml and then it works.

[Feature request] Add a `hold_for` parameter to be able to customize on screen time

From what I understand, currently the only parameters to adjust the on screen time are the duration parameter and the wait_to_start parameter (what the AfterEnd does is a bit obscure by the way). It seem that the element directly fades out after the fade in is finished.

We would benefit by having a hold_for parameter to keep the element dt seconds on screen before the fade out starts.

fade_in => hold => fade_out

panic: overflow when subtracting durations

I got an error in my project after using bevy_splash_screen, I thought I was using it incorrectly because cargo run --example simple -F dev works fine.

I create a new project and copy-paste the code from simple.rs example.

The structure of my test project:

  • assets/bevy_logo.png
  • src/main.rs
  • .gitignore
  • Cargo.lock
  • Cargo.toml

main.rs:

use std::time::Duration;

use bevy::prelude::*;
use bevy_splash_screen::{SplashAssetType, SplashItem, SplashPlugin, SplashScreen};
use bevy_tweening::EaseFunction;

#[derive(Clone, Copy, Debug, Default, States, Hash, PartialEq, Eq)]
enum ScreenStates {
    #[default]
    Splash,
    Menu,
}

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_state::<ScreenStates>()
        .add_plugins(
            SplashPlugin::new(ScreenStates::Splash, ScreenStates::Menu)
                .skipable()
                .add_screen(SplashScreen {
                    brands: vec![
                        SplashItem {
                            asset: SplashAssetType::SingleImage("bevy_logo.png".to_string()),
                            tint: Color::WHITE,
                            width: Val::Percent(60.),
                            height: Val::Px(150.),
                            ease_function: EaseFunction::QuinticInOut.into(),
                            duration: Duration::from_secs_f32(5.),
                            is_static: true,
                        },
                    ],
                    background_color: BackgroundColor(Color::BLACK),
                    ..default()
                }),
        )
        .add_systems(Startup, create_scene)
        .run()
}

fn create_scene(mut cmd: Commands) {
    cmd.spawn(Camera2dBundle::default());
}

Cargo.toml:

[package]
name = "test-splash-screen"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy = "0.11.3"
bevy_splash_screen = "0.4.4"
bevy_tweening = "0.8.0"

The project starts and closes after a few seconds with a panic.

Output:

nikita@Air-Nikita test-splash-screen % cargo run --release              
   Compiling test-splash-screen v0.1.0 (/Users/nikita/Desktop/test/test-splash-screen)
    Finished release [optimized] target(s) in 2.69s
     Running `target/release/test-splash-screen`
2023-10-10T17:16:27.617327Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2023-10-10T17:16:27.631529Z  INFO bevy_winit::system: Creating new window "App" (0v0)
2023-10-10T17:16:27.723033Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.0 ", kernel: "23.0.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }
thread 'Compute Task Pool (0)' panicked at library/core/src/time.rs:930:31:
overflow when subtracting durations
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_tweening::plugin::component_animator_system<bevy_ui::ui_node::BackgroundColor>`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
thread '<unnamed>' panicked at /Users/nikita/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.11.3/src/storage/resource.rs:56:13:
Attempted to access or drop non-send resource bevy_render::view::window::NonSendMarker from thread Some(ThreadId(1)) on a thread ThreadId(12). This is not allowed. Aborting.

Output with RUST_BACKTRACE=full:

nikita@Air-Nikita test-splash-screen % RUST_BACKTRACE=full cargo run --release
    Finished release [optimized] target(s) in 0.40s
     Running `target/release/test-splash-screen`
2023-10-10T17:21:50.342948Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2023-10-10T17:21:50.357772Z  INFO bevy_winit::system: Creating new window "App" (0v0)
2023-10-10T17:21:50.411605Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.0 ", kernel: "23.0.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }
thread 'Compute Task Pool (0)' panicked at library/core/src/time.rs:930:31:
overflow when subtracting durations
stack backtrace:
   0:        0x103b8f848 - std::backtrace_rs::backtrace::libunwind::trace::h0796f85062d1d110
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x103b8f848 - std::backtrace_rs::backtrace::trace_unsynchronized::h37131743b7742f35
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x103b8f848 - std::sys_common::backtrace::_print_fmt::h3d721b30e6a02b1e
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x103b8f848 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8895b8b562a90ee4
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x103bac3d4 - core::fmt::rt::Argument::fmt::h9b2906ecdd0d5723
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/fmt/rt.rs:138:9
   5:        0x103bac3d4 - core::fmt::write::h7a9cc4d1d610bd71
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/fmt/mod.rs:1114:21
   6:        0x103b8d190 - std::io::Write::write_fmt::h87ff59bc697656ff
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/io/mod.rs:1763:15
   7:        0x103b8f688 - std::sys_common::backtrace::_print::hc66b79e8f0b7efad
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x103b8f688 - std::sys_common::backtrace::print::ha692d990665b4a43
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x103b90c88 - std::panicking::default_hook::{{closure}}::hf23c7dbcec5e5d80
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:272:22
  10:        0x103b909a0 - std::panicking::default_hook::h6d5fe0c884e09021
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:292:9
  11:        0x103b911cc - std::panicking::rust_panic_with_hook::h7c3b2a0098acc318
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:731:13
  12:        0x103b910d4 - std::panicking::begin_panic_handler::{{closure}}::h5a56c37d4253c5c6
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:609:13
  13:        0x103b8fcd4 - std::sys_common::backtrace::__rust_end_short_backtrace::h6240b1fcaf592476
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:170:18
  14:        0x103b90e40 - rust_begin_unwind
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:597:5
  15:        0x103c87a50 - core::panicking::panic_fmt::h665dccaf061d2198
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/panicking.rs:72:14
  16:        0x103c87a1c - core::panicking::panic_display::h49e3c7b392046f5b
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/panicking.rs:168:5
  17:        0x103c87a1c - core::panicking::panic_str::h7e8114befff17681
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/panicking.rs:152:5
  18:        0x103c87a1c - core::option::expect_failed::h63330624641ca5a1
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/option.rs:1988:5
  19:        0x103bb09dc - core::option::Option<T>::expect::ha4cf28e79fdb7377
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/option.rs:898:21
  20:        0x103bb09dc - <core::time::Duration as core::ops::arith::Sub>::sub::hb274b849eac081e1
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/time.rs:930:31
  21:        0x102a59b20 - <bevy_tweening::tweenable::Sequence<T> as bevy_tweening::tweenable::Tweenable<T>>::tick::h94415d339fb142f5
  22:        0x102a59b4c - <bevy_tweening::tweenable::Sequence<T> as bevy_tweening::tweenable::Tweenable<T>>::tick::h94415d339fb142f5
  23:        0x102a3dce4 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h06b13d9fef497d2c
  24:        0x102a3d61c - <bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run_unsafe::hf4d53360a974de2e
  25:        0x103adfbd8 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h5d9322fbfbbeb733
  26:        0x103ab5bc0 - async_task::raw::RawTask<F,T,S,M>::run::he53ad1554f021c10
  27:        0x103ae72fc - async_executor::Executor::run::{{closure}}::h9c33a5e6061a86b6
  28:        0x103ae5d7c - futures_lite::future::block_on::hedf76c808ab2ed55
  29:        0x103aea924 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1d4f3216771bcb3d
  30:        0x103ae9f04 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8f9ca3da47ed068d
  31:        0x103b93654 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb4255ffe78e3d6be
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/alloc/src/boxed.rs:2007:9
  32:        0x103b93654 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6065d76bfdbb846b
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/alloc/src/boxed.rs:2007:9
  33:        0x103b93654 - std::sys::unix::thread::Thread::new::thread_start::h86fccd826fc7dcb1
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys/unix/thread.rs:108:17
  34:        0x18b093034 - __pthread_joiner_wake
Encountered a panic in system `bevy_tweening::plugin::component_animator_system<bevy_ui::ui_node::BackgroundColor>`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!
thread '<unnamed>' panicked at /Users/nikita/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.11.3/src/storage/resource.rs:56:13:
Attempted to access or drop non-send resource bevy_render::view::window::NonSendMarker from thread Some(ThreadId(1)) on a thread ThreadId(12). This is not allowed. Aborting.
stack backtrace:
   0:        0x103b8f848 - std::backtrace_rs::backtrace::libunwind::trace::h0796f85062d1d110
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x103b8f848 - std::backtrace_rs::backtrace::trace_unsynchronized::h37131743b7742f35
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x103b8f848 - std::sys_common::backtrace::_print_fmt::h3d721b30e6a02b1e
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:67:5
   3:        0x103b8f848 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8895b8b562a90ee4
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x103bac3d4 - core::fmt::rt::Argument::fmt::h9b2906ecdd0d5723
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/fmt/rt.rs:138:9
   5:        0x103bac3d4 - core::fmt::write::h7a9cc4d1d610bd71
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/fmt/mod.rs:1114:21
   6:        0x103b8d190 - std::io::Write::write_fmt::h87ff59bc697656ff
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/io/mod.rs:1763:15
   7:        0x103b8f688 - std::sys_common::backtrace::_print::hc66b79e8f0b7efad
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x103b8f688 - std::sys_common::backtrace::print::ha692d990665b4a43
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x103b90c88 - std::panicking::default_hook::{{closure}}::hf23c7dbcec5e5d80
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:272:22
  10:        0x103b909a0 - std::panicking::default_hook::h6d5fe0c884e09021
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:292:9
  11:        0x103b911cc - std::panicking::rust_panic_with_hook::h7c3b2a0098acc318
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:731:13
  12:        0x103b910d4 - std::panicking::begin_panic_handler::{{closure}}::h5a56c37d4253c5c6
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:609:13
  13:        0x103b8fcd4 - std::sys_common::backtrace::__rust_end_short_backtrace::h6240b1fcaf592476
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys_common/backtrace.rs:170:18
  14:        0x103b90e40 - rust_begin_unwind
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/panicking.rs:597:5
  15:        0x103c87a50 - core::panicking::panic_fmt::h665dccaf061d2198
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/core/src/panicking.rs:72:14
  16:        0x1034b1154 - bevy_ecs::storage::resource::ResourceData<_>::validate_access::hfbf63342c0eaef1c
  17:        0x10339986c - <alloc::vec::Vec<T,A> as core::ops::drop::Drop>::drop::hc8aa114fff7f0f74
  18:        0x10347e3f8 - core::ptr::drop_in_place<bevy_ecs::storage::resource::Resources<_>>::h65896e25a806697f
  19:        0x10347b374 - core::ptr::drop_in_place<bevy_ecs::world::World>::h18b3e044d6c35157
  20:        0x10347ad70 - core::ptr::drop_in_place<bevy_app::app::App>::h89ab75b986ac2e8f
  21:        0x103484850 - <concurrent_queue::single::Single<T> as core::ops::drop::Drop>::drop::hbe929fe978ee1d26
  22:        0x103436fd0 - core::ptr::drop_in_place<async_channel::Channel<bevy_app::app::SubApp>>::hc87d9539f76495ea
  23:        0x1034389a0 - alloc::sync::Arc<T,A>::drop_slow::h8389202de96ae474
  24:        0x10344c238 - std::sys_common::backtrace::__rust_begin_short_backtrace::hd5329426e268dc18
  25:        0x1033a6b34 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hf5bcd5d821f393c2
  26:        0x103b93654 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb4255ffe78e3d6be
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/alloc/src/boxed.rs:2007:9
  27:        0x103b93654 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6065d76bfdbb846b
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/alloc/src/boxed.rs:2007:9
  28:        0x103b93654 - std::sys::unix::thread::Thread::new::thread_start::h86fccd826fc7dcb1
                               at /rustc/8ce4540bd6fe7d58d4bc05f1b137d61937d3cf72/library/std/src/sys/unix/thread.rs:108:17
  29:        0x18b093034 - __pthread_joiner_wake

But cargo run --example simple -F dev works:

nikita@Air-Nikita bevy_splash_screen % cargo run --example simple -F dev
    Finished dev [optimized + debuginfo] target(s) in 0.34s
     Running `target/debug/examples/simple`
2023-10-10T17:24:19.617050Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
2023-10-10T17:24:19.630684Z  INFO bevy_winit::system: Creating new window "App" (0v0)
2023-10-10T17:24:19.707455Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.0 ", kernel: "23.0.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }
2023-10-10T17:24:32.528119Z  INFO bevy_window::system: No windows are open, exiting
2023-10-10T17:24:32.528460Z  INFO bevy_winit::system: Closing window 0v0

No way to set the position of a SplashItem with SplashType::List

I was trying to set the position of the text in the simple example, but I cannot adjust the position offset of the text (= SplashItem with SingleText) relative to the screen. The text always sticks to the left side of the area defined by the parameter width.

For instance, with width: Val::Percent(100.),:
image
and with width: Val::Percent(60.),:
image

The workaround for now would be to use the Grid layout I guess.

Moreover, the size of the text is set by the font size, so if the width parameter is small than the size defined by the font, the text disappear, which is logical but would take a bit of fiddle around to find the right parameters.

My suggestion would be, for the Grid layout, to:

  • totally ignore the width parameter
  • Use the font size to determine the size of the SingleText widget
  • add an x_center_offset relative the center. The most common use case is to align the text with the center of the screen, ad more rarely to displace it.

Logo flashing before the splashscreen

I have encountered an issue when integrating the splashscreen into my game but I haven't been able to fully extract a MWE yet.

I have a state structure as follows: Loading => Splashscreen => Menu
I'm using the asset loader before the splash screen (but don't use it to load the logo). I have just copy-pasted the code from the simpleexample directly into my game.

When the Splashscreen starts, the bey logo flashes very quickly, then disappear, then reappears again with fading this time with the Splashscreen working as intended.

I'm not totally sure what could be the issue. Maybe a problem with the state transition?

PS: skippable takes 2 p, there is a typo in the crate.

Skip screens with input

It would be beneficial to have the option to skip a screen (or all screens) with player input.

I think a SkipSplashScreenEvent could be exposed that games can write to. This way, the game can fire this event with whatever logic they use to read input (Res<Input<...>>, leafwing_input_manager).

It would be helpful if the event struct had a boolean field to indicate if all (remaining) screens should be skipped or only the active one.

The alternative is just a public function on the splash screens resource that a system in the game can invoke. Guess it's personal preference as to which approach!

Text not tweening?

I've been fiddling around with this cool crate, but I wasn't seeing Text being faded in and out.

Looking at lib.rs, where you are doing the build for the Plugin, surely you need to create a system for

component_animator_system::<Text>.run_if(in_state(self.state.clone())),

in addition to the one for BackgroundColor (which makes the images fade)?

That seems to fix my problems, at least.

Make tween effects more customizable

For this I have not thought of a way to do it but I think it is a very interesting feature to have because it can allow whoever uses the plugin to have something much more adapted to their needs.

Inconsistent color definition

I was looking at the Simple example (it also applies to other examples as well) and in particular that part of the code:

SplashItem {
                            asset: SplashAssetType::SingleText(
                                Text::from_sections([
                                    TextSection::new(
                                        "Simple Test\n",
                                        TextStyle {
                                            font_size: 40.,
                                            color: Color::WHITE,
                                            ..default()
                                        },
                                    ),
                                    TextSection::new(
                                        "by\n",
                                        TextStyle {
                                            font_size: 24.,
                                            color: Color::WHITE.with_a(0.75),
                                            ..default()
                                        },
                                    ),
                                    TextSection::new(
                                        "Sergio Ribera",
                                        TextStyle {
                                            font_size: 32.,
                                            color: Color::WHITE,
                                            ..default()
                                        },
                                    ),
                                ])
                                .with_alignment(TextAlignment::Center),
                                "FiraSans-Bold.ttf".to_string(),
                            ),
                            tint: Color::SEA_GREEN,
                            width: Val::Percent(30.),
                            height: Val::Px(150.),
                            ease_function: EaseFunction::QuarticInOut.into(),
                            duration: Duration::from_secs_f32(5.),
                            is_static: false,
                        }

When I compile it, the text is SEA_GREEN, not white. It seems there is no way to set the color separately for each of the TextSection, everything is overwritten by the tint field value.

Crashes with Splash Screen and bevy_asset_loader

I am combining both this crate and bevy_asset_loader. However I am getting an occasional error where clicking too fast to skip will crash the game. I've traced this to the fact that the splash_skip function runs in any state and therefore when my app is in the loading state clicking will skip to the game state before its loaded and will cause systems to crash because the game hasnt been properly loaded.

Solution

If splash_skip is given a .run_if(in_state(self.state.clone())) then it should fix these issues and correctly only let the splash be skipped when its actually being run

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.