Skip to content

Commit

Permalink
#32 - Using chevron arrow as player FOV marker
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbrzeski committed Oct 20, 2024
1 parent 9e4da79 commit ece5a67
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions client/src/app/scenograph/overlays/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class Map {
// Create the fov icon
this.fov = document.createElement('div');
this.fov.id = 'map-fov';
this.fov.innerHTML = this.icons.fov;
this.container.appendChild(this.fov);

}
Expand All @@ -44,6 +45,7 @@ export default class Map {
iconTemplate.innerHTML = document.querySelector('#templates #map_icons').innerHTML;

icons.aircraft = iconTemplate.querySelector('.aircraft').innerHTML;
icons.fov = iconTemplate.querySelector('.fov').innerHTML;
icons.ship = iconTemplate.querySelector('.ship').innerHTML;
icons.special = iconTemplate.querySelector('.special').innerHTML;
icons.structure = iconTemplate.querySelector('.structure').innerHTML;
Expand Down
7 changes: 7 additions & 0 deletions client/src/assets/map_icons/fov.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 3 additions & 7 deletions client/src/styles/overlays/game.styl
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,10 @@
left: @css{ min(2.5vw, 2.5vh) };

#map-fov {
--p: 3.5px; /* control the shape (can be percentage) */
height: 10px;
aspect-ratio: 3/2;
clip-path: polygon(var(--p) 100%,calc(100% - var(--p)) 100%,100% 0,0 0);
background: radial-gradient(rgba(#FFF, 0.35) 5%, rgba(#FFF, 0.5) 95%);
height: 15px;
position: absolute;
left: calc( 50% - 6.5px );
top: calc( 50% - 5px );
left: calc( 50% - 7.5px );
top: calc( 50% - 7.5px );
}

.marker {
Expand Down
2 changes: 2 additions & 0 deletions client/src/templates/partials/overlays/map-icons.pug
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.fov
include ../../../assets/map_icons/fov.svg
.aircraft
include ../../../assets/map_icons/aircraft.svg
.ship
Expand Down

0 comments on commit ece5a67

Please sign in to comment.