generated from tipragot/rust
save
This commit is contained in:
parent
b7e3e9da9c
commit
3a9f75bcfe
BIN
crates/border-wars/assets/temp.png
Normal file
BIN
crates/border-wars/assets/temp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,014 B |
|
@ -1,6 +1,7 @@
|
||||||
//! All programs related to the clicking on a tile.
|
//! All programs related to the clicking on a tile.
|
||||||
|
|
||||||
use bevy::{input::mouse::MouseButtonInput, prelude::*};
|
use bevy::input::mouse::MouseButtonInput;
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use super::Tile;
|
use super::Tile;
|
||||||
|
|
||||||
|
|
|
@ -65,21 +65,38 @@ fn handle_tile_click(
|
||||||
transform.translation.y += 10.;
|
transform.translation.y += 10.;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_text_zone(mut commands: Commands) {
|
fn init_text_zone(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
commands
|
commands
|
||||||
.spawn(TextBundle {
|
.spawn(ImageBundle {
|
||||||
style: Style {
|
style: Style {
|
||||||
position_type: PositionType::Absolute,
|
position_type: PositionType::Absolute,
|
||||||
|
height: Val::Percent(50.),
|
||||||
|
width: Val::Percent(50.),
|
||||||
|
bottom: Val::ZERO,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
|
||||||
|
image: UiImage {
|
||||||
|
texture: asset_server.load("temp.png"),
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
..default()
|
||||||
|
})
|
||||||
|
.with_children(|builder| {
|
||||||
|
builder
|
||||||
|
.spawn(TextBundle {
|
||||||
|
style: Style {
|
||||||
|
height:Val::Percent(100.),
|
||||||
|
position_type: PositionType::Absolute,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
..default()
|
..default()
|
||||||
})
|
})
|
||||||
.insert(TileInfoText);
|
.insert(TileInfoText);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TODO
|
/// TODO
|
||||||
|
@ -109,3 +126,14 @@ fn update_tile_info_text(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// .spawn(TextBundle {
|
||||||
|
// style: Style {
|
||||||
|
// position_type: PositionType::Absolute,
|
||||||
|
//
|
||||||
|
// ..default()
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// ..default()
|
||||||
|
// })
|
||||||
|
// .insert(TileInfoText);
|
||||||
|
|
Loading…
Reference in a new issue