Add crosshair

This commit is contained in:
Piotr Korgól 2019-07-02 21:54:38 +02:00
parent 7f08377001
commit 7cf299503d
3 changed files with 15 additions and 5 deletions

Binary file not shown.

View File

@ -49,9 +49,6 @@ image_ids! {
chat_arrow_mo: "voxygen/element/buttons/arrow_down_hover.vox",
chat_arrow_press: "voxygen/element/buttons/arrow_down_press.vox",
// Crosshair
crosshair: "voxygen/element/misc_bg/crosshair.vox",
////////////////////////////////////////////////////////////////////////
<VoxelMs9Graphic>
@ -122,6 +119,9 @@ image_ids! {
button_hover: "voxygen/element/buttons/button_hover.vox",
button_press: "voxygen/element/buttons/button_press.vox",
// Other
crosshair: "voxygen/element/misc_bg/crosshair.vox",
//////////////////////////////////////////////////////////////////////////////////////////////////////
<ImageGraphic>

View File

@ -48,6 +48,9 @@ const MANA_COLOR: Color = Color::Rgba(0.42, 0.41, 0.66, 1.0);
widget_ids! {
struct Ids {
// Crosshair
crosshair,
// Character Names
name_tags[],
// Health Bars
@ -330,6 +333,13 @@ impl Hud {
let mut health_id_walker = self.ids.health_bars.walk();
let mut health_back_id_walker = self.ids.health_bar_backs.walk();
// Crosshair
Image::new(self.imgs.crosshair)
.w_h(21.0 * 2.0, 21.0 * 2.0)
.middle_of(ui_widgets.window)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0)))
.set(self.ids.crosshair, ui_widgets);
// Render Name Tags
for (pos, name) in (&entities, &pos, &stats, player.maybe())
.join()