Modeled after the 'To Frames' functionality in GameMaker.
Functions
sheet
sheet(count, width, height, perRow, offsets?, hsep?, vsep?) -> struct<spritesheet.Spritesheet>
- count
int
- width
int
- height
int
- perRow
int
- offsets
struct<spritesheet.Offset>
- hsep
int
- vsep
int
struct<spritesheet.Spritesheet>
offset
offset(hpixel, vpixel, hcell, vcell, index) -> struct<spritesheet.Offset>
- hpixel
int
- vpixel
int
- hcell
int
- vcell
int
- index
int
struct<spritesheet.Offset>
offset_pixel
offset_pixel(hpixel, vpixel) -> struct<spritesheet.Offset>
- hpixel
int
- vpixel
int
struct<spritesheet.Offset>
offset_cell
offset_cell(hcell, vcell) -> struct<spritesheet.Offset>
- hcell
int
- vcell
int
struct<spritesheet.Offset>
offset_index
offset_index(index) -> struct<spritesheet.Offset>
- index
int
struct<spritesheet.Offset>
to_frames
to_frames(id, name, spritesheet, nocopy?) -> []int<collection.IMAGE>
- id
int<collection.IMAGE>
- name
string
- Will be prefixed using the frame index as '%d_name'. - spritesheet
struct<spritesheet.Spritesheet>
- nocopy
bool
[]int<collection.IMAGE>
to_frames_cached
to_frames_cached(id, spritesheet, nocopy?) -> []int<collection.CRATE_CACHEDIMAGE>
@blocking
- id
int<collection.IMAGE>
- spritesheet
struct<spritesheet.Spritesheet>
- nocopy
bool
[]int<collection.CRATE_CACHEDIMAGE>
to_frames_into_cached
to_frames_into_cached(id, ids, spritesheet, nocopy?)
@blocking
- id
int<collection.IMAGE>
- ids
[]int<collection.CRATE_CACHEDIMAGE>
- Must be the same length as the amount of frames in the spritesheet. - spritesheet
struct<spritesheet.Spritesheet>
- nocopy
bool
[]int<collection.CRATE_CACHEDIMAGE>
from_frames
from_frames(ids, name, model, encoding, spritesheet) -> int<collection.IMAGE>
- ids
[]int<collection.IMAGE>
- name
string
- model
int<image.ColorModel>
- encoding
int<image.Encoding>
- spritesheet
struct<spritesheet.Spritesheet>
int<collection.IMAGE>
from_frames_into
from_frames_into(ids, id, model, spritesheet)
- ids
[]int<collection.IMAGE>
- id
int<collection.IMAGE>
- model
int<image.ColorModel>
- spritesheet
struct<spritesheet.Spritesheet>
extract
extract(id, name, spritesheet_in, spritesheet_out, nocopy?) -> int<collection.IMAGE>
Note it is more efficient to exclude frames using index and count from spritesheet_in than from spritesheet_out. This prevents them from being sub-imaged completely.
- id
int<collection.IMAGE>
- name
string
- spritesheet_in
struct<spritesheet.Spritesheet>
- The spritesheet related to the source image. - spritesheet_out
struct<spritesheet.Spritesheet>
- The spritesheet related to the returned image. - nocopy
bool
int<collection.IMAGE>
extract_into
extract_into(id, idinto, spritesheet_in, spritesheet_out, nocopy?)
Note it is more efficient to exclude frames using index and count from spritesheet_in than from spritesheet_out. This prevents them from being sub-imaged completely.
- id
int<collection.IMAGE>
- idinto
int<collection.IMAGE>
- spritesheet_in
struct<spritesheet.Spritesheet>
- The spritesheet related to the source image. - spritesheet_out
struct<spritesheet.Spritesheet>
- The spritesheet related to the returned image. - nocopy
bool
Structs
Spritesheet
- count
int
- width
int
- height
int
- perRow
int
- offsets
struct<spritesheet.Offset>
- hsep
int
- vsep
int
Offset
- hpixel
int
- vpixel
int
- hcell
int
- vcell
int
- index
int