new : ( Basics.Float, Basics.Float ) -> List ( String, List (Html.Attribute msg) -> Html msg ) -> List (Game.Entity.Entity ( String, List (Html.Attribute msg) -> Html msg ))
create a new entity in an area using a position and a key(string).
toHtml : List (Html.Attribute msg) -> List (Game.Entity.Entity ( String, List (Html.Attribute msg) -> Html msg )) -> Html msg
Turn the area into Html. Animation can only happen within an area. If an entity should move from one area into another, you have to use pileAbove
to define the sub-areas.
You can change the transition speed:
speedInSec =
0.5
toHtml [Html.Attributes.style "transition" ("transform " ++ String.fromInt speedInSec ++ "s")]
map : (Basics.Int -> a -> b) -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity b)
Map the contents of a list of entities
mapPosition : (Basics.Int -> a -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float )) -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity a)
Map the position of each entity in a list
mapPositionRandomly : (Basics.Int -> a -> ( Basics.Float, Basics.Float ) -> Random.Generator ( Basics.Float, Basics.Float )) -> List (Game.Entity.Entity a) -> Random.Generator (List (Game.Entity.Entity a))
Move each element of the list to a random position.
mapRotation : (Basics.Int -> a -> Basics.Float -> Basics.Float) -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity a)
Map the rotation of each entity in a list
mapRotationRandomly : (Basics.Int -> a -> Basics.Float -> Random.Generator Basics.Float) -> List (Game.Entity.Entity a) -> Random.Generator (List (Game.Entity.Entity a))
Apply a random rotation to each element of the list.
mapZIndex : (Basics.Int -> a -> Basics.Int -> Basics.Int) -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity a)
Map the z-Index of each entity in a list
draggable : { onPress : Maybe msg, onRelease : Maybe msg } -> List (Html.Attribute msg)
assigns three events: onMouseUp, onMouseDown and onClick (useful for touch screens).
onClick will perform the onPress action and if that does not exist, it will perform the onRelease action instead.
hoverable : { onEnter : Maybe msg, onLeave : Maybe msg } -> List (Html.Attribute msg)
Define hover events
pileAbove : ( Basics.Float, Basics.Float ) -> ( String, List (Html.Attribute msg) -> Html msg ) -> List (Game.Entity.Entity ( String, List (Html.Attribute msg) -> Html msg )) -> List (Game.Entity.Entity ( String, List (Html.Attribute msg) -> Html msg ))
Create a pile in an area.
withLinearRotation : { min : Basics.Float, max : Basics.Float } -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity a)
rotate each element of a list evenly within a given interval.
withPolarPosition : { minAngle : Basics.Float, maxAngle : Basics.Float, minDistance : Basics.Float, maxDistance : Basics.Float } -> List (Game.Entity.Entity a) -> List (Game.Entity.Entity a)
move each element in a list evenly with respect to angle and distance of the original position.