Skip to content
Snippets Groups Projects
Unverified Commit 4797dbd4 authored by StaffEngineer's avatar StaffEngineer Committed by GitHub
Browse files

update example for wasm (#76)

parent eadba6fc
No related branches found
No related tags found
No related merge requests found
use bevy::{prelude::*, window::PrimaryWindow}; use bevy::{
prelude::*,
window::{PresentMode, PrimaryWindow},
};
use bevy_cosmic_edit::*; use bevy_cosmic_edit::*;
fn create_editable_widget(commands: &mut Commands, scale_factor: f32, text: String) -> Entity { 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 { ...@@ -109,7 +112,20 @@ fn bevy_color_to_cosmic(color: bevy::prelude::Color) -> CosmicColor {
fn main() { fn main() {
App::new() 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_plugins(CosmicEditPlugin::default())
.add_systems(Update, handle_enter) .add_systems(Update, handle_enter)
.add_systems(Startup, setup) .add_systems(Startup, setup)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment