» Uncategorized Posts

set_character_color_slot

Changes the color slot of the currently selected color profile, affecting only the character and leaving articles alone.

ArgumentTypeDescription
shade:realThe color slot to change
red:realThe Red value to set the color to.
Should be between 0 and 255.
green:realThe Green value to set the color to.
Should be between 0 and 255.
blue:realThe Blue value to set the color to.
Should be between 0 and 255.
alpha:realThe Alpha value to set the color to, with 0 being fully transparent and 1 being opaque.

Example, called from post_draw.gml:

//This code sets the player's first color slot to be a partially-transparent white if they're set to a specific palette.
if get_player_color(player) == 13 {
set_character_color_slot(0, 255, 255, 255, 0.5);
}

get_color_profile_slot_b

Returns the blue component of a character’s color slot, with a value from 0 to 255. Note that this does not take into account changes made by set_character_color_slot or set_article_color_slot.

ArgumentTypeDescription
color:realThe color profile to check
shade:realThe specific color of the profile to check

Example, called from post_draw.gml:

//This code draws a custom sprite tinted to the exact color of the player's first color slot.
var col_R = get_color_profile_slot_r( get_player_color(player), 0);
var col_G = get_color_profile_slot_g( get_player_color(player), 0);
var col_B = get_color_profile_slot_b( get_player_color(player), 0);

var col_final = make_color_rgb(col_r, col_g, col_b);

draw_sprite_ext(sprite_get("custom_sprite"), image_index, x, y, image_xscale, image_yscale, image_angle, col_final, image_alpha);

get_color_profile_slot_g

Returns the green component of a character’s color slot, with a value from 0 to 255. Note that this does not take into account changes made by set_character_color_slot or set_article_color_slot.

ArgumentTypeDescription
color:realThe color profile to check
shade:realThe specific color of the profile to check

Example, called from post_draw.gml:

//This code draws a custom sprite tinted to the exact color of the player's first color slot.
var col_R = get_color_profile_slot_r( get_player_color(player), 0);
var col_G = get_color_profile_slot_g( get_player_color(player), 0);
var col_B = get_color_profile_slot_b( get_player_color(player), 0);

var col_final = make_color_rgb(col_r, col_g, col_b);

draw_sprite_ext(sprite_get("custom_sprite"), image_index, x, y, image_xscale, image_yscale, image_angle, col_final, image_alpha);

get_color_profile_slot_r

Returns the red component of a character’s color slot, with a value from 0 to 255. Note that this does not take into account changes made by set_character_color_slot or set_article_color_slot.

ArgumentTypeDescription
color:realThe color profile to check
shade:realThe specific color of the profile to check

Example, called from post_draw.gml:

//This code draws a custom sprite tinted to the exact color of the player's first color slot.
var col_R = get_color_profile_slot_r( get_player_color(player), 0);
var col_G = get_color_profile_slot_g( get_player_color(player), 0);
var col_B = get_color_profile_slot_b( get_player_color(player), 0);

var col_final = make_color_rgb(col_r, col_g, col_b);

draw_sprite_ext(sprite_get("custom_sprite"), image_index, x, y, image_xscale, image_yscale, image_angle, col_final, image_alpha);

shake_camera

Sets the camera shake.

ArgumentTypeDescription
intensity:realThe intensity of the camera shake
time:realThe time it should shake for, in frames

Note that this will override any other camera shake currently happening.

Example, called from update.gml:

//Makes the camera shake for 6 frames when the player lands.
if (state == PS_LAND or state == PS_LANDING_LAG) && state_timer == 1 {
shake_camera( 8, 6 )
}