mirror of
https://github.com/Vale54321/schafkop-neu.git
synced 2025-12-13 10:39:33 +01:00
add responsive canvas fitting
This commit is contained in:
@@ -2,10 +2,32 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Schafkopf Logic</title>
|
<title>Schafkopf Logic</title>
|
||||||
<link data-trunk rel="rust" href="Cargo.toml" />
|
<link data-trunk rel="rust" href="Cargo.toml" />
|
||||||
|
|
||||||
<link data-trunk rel="copy-dir" href="assets" />
|
<link data-trunk rel="copy-dir" href="assets" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas {
|
||||||
|
display: block;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body></body>
|
<body></body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use bevy::{
|
|||||||
asset::{AssetMetaCheck, AssetPlugin, RenderAssetUsages},
|
asset::{AssetMetaCheck, AssetPlugin, RenderAssetUsages},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
render::render_resource::{Extent3d, TextureDimension, TextureFormat},
|
render::render_resource::{Extent3d, TextureDimension, TextureFormat},
|
||||||
|
window::{WindowPlugin, Window},
|
||||||
};
|
};
|
||||||
use bevy::ecs::relationship::Relationship;
|
use bevy::ecs::relationship::Relationship;
|
||||||
use schafkopf_logic::{
|
use schafkopf_logic::{
|
||||||
@@ -82,12 +83,20 @@ struct BaseCardSprite;
|
|||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins(
|
.add_plugins(
|
||||||
DefaultPlugins.set(
|
DefaultPlugins
|
||||||
AssetPlugin {
|
.set(WindowPlugin {
|
||||||
|
primary_window: Some(Window {
|
||||||
|
fit_canvas_to_parent: true,
|
||||||
|
..default()
|
||||||
|
}),
|
||||||
|
..default()
|
||||||
|
})
|
||||||
|
.set(AssetPlugin {
|
||||||
meta_check: AssetMetaCheck::Never,
|
meta_check: AssetMetaCheck::Never,
|
||||||
..default()
|
..default()
|
||||||
}
|
})
|
||||||
).set(ImagePlugin::default_nearest()))
|
.set(ImagePlugin::default_nearest())
|
||||||
|
)
|
||||||
.add_systems(Startup, (setup_game, spawn_click_text))
|
.add_systems(Startup, (setup_game, spawn_click_text))
|
||||||
// Spawn the player hand once the atlas image is fully loaded
|
// Spawn the player hand once the atlas image is fully loaded
|
||||||
.add_systems(Update, spawn_player_hand)
|
.add_systems(Update, spawn_player_hand)
|
||||||
|
|||||||
Reference in New Issue
Block a user