From 4797dbd4e637457163e5d109ce6024b32c441bde Mon Sep 17 00:00:00 2001 From: StaffEngineer <111751109+StaffEngineer@users.noreply.github.com> Date: Thu, 5 Oct 2023 23:28:33 +0100 Subject: [PATCH] update example for wasm (#76) --- examples/text_input.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/examples/text_input.rs b/examples/text_input.rs index f8e6773..f031b98 100644 --- a/examples/text_input.rs +++ b/examples/text_input.rs @@ -1,4 +1,7 @@ -use bevy::{prelude::*, window::PrimaryWindow}; +use bevy::{ + prelude::*, + window::{PresentMode, PrimaryWindow}, +}; use bevy_cosmic_edit::*; fn create_editable_widget(commands: &mut Commands, scale_factor: f32, text: String) -> Entity { @@ -109,7 +112,20 @@ fn bevy_color_to_cosmic(color: bevy::prelude::Color) -> CosmicColor { fn main() { App::new() - .add_plugins(DefaultPlugins) + .add_plugins( + DefaultPlugins + .set(WindowPlugin { + primary_window: Some(Window { + title: "bevy • text_input".into(), + present_mode: PresentMode::AutoVsync, + fit_canvas_to_parent: true, + prevent_default_event_handling: false, + ..default() + }), + ..default() + }) + .build(), + ) .add_plugins(CosmicEditPlugin::default()) .add_systems(Update, handle_enter) .add_systems(Startup, setup) -- GitLab