forked from DigitalExtinction/Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(controller): add simple blocking HUD
Added initial HUD without actions DigitalExtinction#22 Added node for minimap DigitalExtinction#100
- Loading branch information
Showing
4 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
use bevy::prelude::*; | ||
|
||
use crate::hud::HudTopVisibleNode; | ||
|
||
const HUD_COLOR: Color = Color::BLACK; | ||
|
||
pub(crate) fn spawn_details(commands: &mut Commands) { | ||
commands.spawn(( | ||
NodeBundle { | ||
style: Style { | ||
size: Size { | ||
width: Val::Percent(20.), | ||
height: Val::Percent(30.), | ||
}, | ||
align_items: AlignItems::Stretch, | ||
flex_direction: FlexDirection::Column, | ||
position_type: PositionType::Absolute, | ||
position: UiRect::new( | ||
Val::Percent(0.), Val::Percent(20.), | ||
Val::Percent(70.), Val::Percent(100.), | ||
), | ||
..default() | ||
}, | ||
background_color: HUD_COLOR.into(), | ||
..default() | ||
}, | ||
HudTopVisibleNode | ||
)); | ||
} | ||
|
||
pub(crate) fn spawn_action_bar(commands: &mut Commands) { | ||
commands.spawn(( | ||
NodeBundle { | ||
style: Style { | ||
size: Size { | ||
width: Val::Percent(60.), | ||
height: Val::Percent(15.), | ||
}, | ||
flex_direction: FlexDirection::Row, | ||
position_type: PositionType::Absolute, | ||
position: UiRect::new( | ||
Val::Percent(20.), Val::Percent(80.), | ||
Val::Percent(85.), Val::Percent(100.), | ||
), | ||
..default() | ||
}, | ||
background_color: HUD_COLOR.into(), | ||
..default() | ||
}, | ||
HudTopVisibleNode, | ||
)); | ||
} | ||
|
||
pub(crate) fn spawn_map(commands: &mut Commands) { | ||
commands.spawn(( | ||
NodeBundle { | ||
style: Style { | ||
size: Size { | ||
width: Val::Percent(20.), | ||
height: Val::Percent(30.), | ||
}, | ||
align_items: AlignItems::Stretch, | ||
flex_direction: FlexDirection::Column, | ||
position_type: PositionType::Absolute, | ||
position: UiRect::new( | ||
Val::Percent(80.), Val::Percent(100.), | ||
Val::Percent(70.), Val::Percent(100.), | ||
), | ||
..default() | ||
}, | ||
background_color: HUD_COLOR.into(), | ||
..default() | ||
}, | ||
HudTopVisibleNode | ||
)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters