View Source Avatarex.Set (Avatarex v0.1.1)
This module provides functions for creating an AvatarexSet
Link to this section Summary
Functions
Generates all functions for generating AvatarexSet
s and associated renders
Link to this section Functions
Generates all functions for generating AvatarexSet
s and associated renders
Required opts:
set_dir: "/path/to/my_set/"
keys: [:field1, :field2, :field3]
set_dir
path to set directory: "/path/to/my_set/"
keys
correspond to folders under the set_dir
, ex: "/path/to/my_set/field1"
keys
ordering will correspond to image layering. [:base_layer, :next_layer, ...]
Optional opts: otp_app: :my_app ren_dir: "/path/to/render/"
By default, Avatarex.Set expects renders to be stored under the priv/renders
directory of an application. This behaviour can be changed by specifying a
ren_dir:
option when using Avatarex.Set
:
# Look for renders in my_app/priv/images instead of
# my_app/priv/renders
use Avatarex.Set, otp_app: :my_app, ren_dir: "images"
Both set_dir
and ren_dir
accept both path strings and word lists.
Paths are expected to be relative to /priv
.
examples
Examples
iex> use Elixir.Avatarex.Set, dir: "/path/to/my_set", keys: [:field1, :field2, :field3]