CollageSprite - coldrockgames/gml-raptor GitHub Wiki
For every file or object or sprite sheet you add to COLLAGE
, a class instance of CollageSprite
is created and cached internally in the CollageManager (COLLAGE
).
This is very important for setting your collision masks, if you need something else than GameMaker's default of Automatic
Rectangular
.
As shown in the Collage Builder Example, there are several methods available to define your collision mask. They are all in a builder pattern, including the .build()
method, so you may freely chain your calls.
Methods of CollageSprite
set_mask_automatic
/// @func set_mask_automatic(_shape = bboxkind_rectangular, _tolerance = 0)
/// @desc Set automatic collision mask (gamemaker default)
static set_mask_automatic = function(_shape = bboxkind_rectangular, _tolerance = 0) {
set_mask_full_image
/// @func set_mask_full_image(_shape = bboxkind_rectangular, _tolerance = 0)
/// @desc Set a full-image mask with a shape
static set_mask_full_image = function(_shape = bboxkind_rectangular, _tolerance = 0) {
set_mask_manual
/// @func set_mask_manual(_left, _top, _right, _bottom, _shape = bboxkind_rectangular)
/// @desc Set a manuel mask with border and shape
static set_mask_manual = function(_left, _top, _right, _bottom, _shape = bboxkind_rectangular) {
set_mask_precise
/// @func set_mask_precise(_per_frame = true, _tolerance = 0)
/// @desc Set a precise mask, optionally per frame
static set_mask_precise = function(_per_frame = true, _tolerance = 0) {
build
/// @func build()
/// @desc Builds the collision mask of the sprite
static build = function() {