vec/dict/vec2i_dict
Values
pub fn anchor_position(
dict: dict.Dict(vec2.Vec2(Int), value),
at position: vec2.Vec2(Int),
then fun: fn(dict.Dict(vec2.Vec2(Int), value)) -> dict.Dict(
vec2.Vec2(Int),
value,
),
) -> dict.Dict(vec2.Vec2(Int), value)
Return the equivalent of dict |> offset(vec2i.negate(position)) |> fun() |> offset(position).
pub fn anchor_rotation(
dict: dict.Dict(vec2.Vec2(Int), value),
at angle: Int,
then fun: fn(dict.Dict(vec2.Vec2(Int), value)) -> dict.Dict(
vec2.Vec2(Int),
value,
),
) -> dict.Dict(vec2.Vec2(Int), value)
Return the equivalent of dict |> rotate(-angle) |> fun() |> rotate(angle).
pub fn from_list(
list: List(List(option.Option(a))),
) -> dict.Dict(vec2.Vec2(Int), a)
Converts a list of list of optional values to a vec-dict start from
Vec2(0, 0) where the outer lists index is y and inner lists index is
x.
pub fn from_string(
string: String,
) -> dict.Dict(vec2.Vec2(Int), String)
Converts a string to a vec-dict of graphemes start from Vec2(0, 0) where
the lines index is y and graphemes index is x.
pub fn mirror(
in dict: dict.Dict(vec2.Vec2(Int), value),
through normal: vec2.Vec2(Int),
) -> dict.Dict(vec2.Vec2(Int), value)
Returns the mirror of a vec-dict through a plane defined by the given normal vector.
pub fn new_rectangle(
from start: vec2.Vec2(Int),
to stop: vec2.Vec2(Int),
with fun: fn(vec2.Vec2(Int)) -> value,
) -> dict.Dict(vec2.Vec2(Int), value)
Deprecated: Vendor this function into your codebase
pub fn offset(
in dict: dict.Dict(vec2.Vec2(Int), value),
by vector: vec2.Vec2(Int),
) -> dict.Dict(vec2.Vec2(Int), value)
Deprecated: Renamed to `translate`
pub fn rotate(
in dict: dict.Dict(vec2.Vec2(Int), value),
by angle: Int,
) -> dict.Dict(vec2.Vec2(Int), value)
Rotate a vec-dict by an angle (in 90 degree steps).