Runtime
sprite_get_data
sprite_get_data(sprite_index)
Gets the custom data from the data table in "Sprite Data" section of sprite editor.
var _spr_data = sprite_get_data(spr_player);
shadow_sprite = _spr_data.shadow_sprite;
sprite_get_data_point
sprite_get_data_point(sprite_index, image_index, point_name)
Returns the PointFrame for a point at a given sprite_index, image_index, point_name pair. The data contained in the struct will depend on what point type you used. Watch out for crashes on accessing invalid properties on the wrong type.
var _hat = sprite_get_data_point(sprite_index, image_index, "hat");
draw_self();
draw_sprite(_hat.sprite, 0, x + _hat.x, y + _hat.y);
var _left_hand = sprite_get_data_point(sprite_index, image_index, "left_hand");
draw_circle(x + _left_hand.x, y + _left_hand.y, 2, false);
sprite_rotate_data_point_x
sprite_rotate_data_point_x(_data_point, image_angle)
Returns the data point x position from a PointFrame rotated about the root sprite's origin with image_angle
var _left_hand = sprite_get_data_point(sprite_index, image_index, "left_hand");
draw_set_color(c_red);
draw_circle(x + sprite_rotate_data_point_x(_left_hand, image_angle), y + sprite_rotate_data_point_y(_left_hand, image_angle), 2, false);
sprite_rotate_data_point_y
sprite_rotate_data_point_y(_data_point, image_angle)
Returns the data point y position from a PointFrame rotated about the root sprite's origin with image_angle
var _left_hand = sprite_get_data_point(sprite_index, image_index, "left_hand");
draw_set_color(c_red);
draw_circle(x + sprite_rotate_data_point_x(_left_hand, image_angle), y + sprite_rotate_data_point_y(_left_hand, image_angle), 2, false);
PointFrame
PointFrame
{
// shared by all shape types
is_valid,
is_keyframe,
type,
x,
y,
shape_color,
// your custom data table
data
// these props will only exist depending on the type
// you selected in editor
// for sprites
sprite,
image_angle,
image_scalex,
image_scaley,
image_alpha,
image_color,
// for circles
radius,
// for boxes
box_width,
box_height,
}
