summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-10-18 20:59:41 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-10-18 20:59:41 +0200 |
commit | 96d7905f7faef941f5454fd2c8b0b50a294fd26c (patch) | |
tree | 77377c56ed005fc56dcaad506f0f12bb598fef66 /elm/battlemap/src/View/Battlemap/Tile.elm | |
parent | 2805c647010cbcca126ebf162fcbdd691fc72488 (diff) |
Borked mouse controls for the navigator, it seems.
Diffstat (limited to 'elm/battlemap/src/View/Battlemap/Tile.elm')
-rw-r--r-- | elm/battlemap/src/View/Battlemap/Tile.elm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/elm/battlemap/src/View/Battlemap/Tile.elm b/elm/battlemap/src/View/Battlemap/Tile.elm new file mode 100644 index 0000000..d38d84e --- /dev/null +++ b/elm/battlemap/src/View/Battlemap/Tile.elm @@ -0,0 +1,39 @@ +module View.Battlemap.Tile exposing (get_html) + +import Html +import Html.Attributes +import Html.Events + +import Battlemap.Tile +import Battlemap.Location + +import Event + +get_html : ( + Int -> + Battlemap.Tile.Type -> + (Html.Html Event.Type) + ) +get_html tile_size tile = + let + tile_loc = (Battlemap.Tile.get_location tile) + in + (Html.div + [ + (Html.Attributes.class "battlemap-tile-icon"), + (Html.Attributes.class + ("asset-tile-" ++ (toString (Battlemap.Tile.get_icon_id tile))) + ), + (Html.Events.onClick + (Event.TileSelected (Battlemap.Location.get_ref tile_loc)) + ), + (Html.Attributes.style + [ + ("top", ((toString (tile_loc.y * tile_size)) ++ "px")), + ("left", ((toString (tile_loc.x * tile_size)) ++ "px")) + ] + ) + ] + [ + ] + ) |