mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add crosshair
This commit is contained in:
parent
7f08377001
commit
7cf299503d
BIN
assets/voxygen/element/misc_bg/crosshair.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/misc_bg/crosshair.vox
(Stored with Git LFS)
Binary file not shown.
@ -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>
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user