Images


This allows a modder to specify custom information about how a sprite added externally should be treated.

Note: This is not needed if you are replacing a built-in sprite. As this will instead use the information of the built-in sprite.

You may define some images by creating a images.kdr file.

The following properties that exist:

Key Type Explanation
name String The name of the image on disk or in-game.
xoffset Number or String The offset that the image should have on the x axis.
yoffset Number or String The offset the the image should have on the y axis.
speed Number The speed that the image should animate as.
speed_type String The speed type to anime from.
tags String (multiple) The asset tags to apply to the image, with each tag denoted between commas
tag String The asset tag to apply to the image.
bbox_mode String The collision mode that is used to calculate the image collision box. See down below for more.
bbox_kind String The kind of collision to build. See down below for more.
bb_left Number If bbox_mode is set to manual, the left bounding box to assign.
bb_top Number If bbox_mode is set to manual, the top bounding box to assign.
bb_right Number If bbox_mode is set to manual, the right bounding box to assign.
bb_bottom Number If bbox_mode is set to manual, the bottom bounding box to assign.
separate_masks Number If bbox_kind is set to precise, determines if separate masks should be generated per frame.
tolerance Number If bbox_kind is set to precise, the threshold for a pixel alpha before it is used to make a pixel collidable.
speed_type String The speed type to use. See down below for more.

Some keys have specific keywords that modify the properties of the sprite in a specific way.

xoffset

Key Explanation
"left" Aligns the xoffset to the left side of the image.
"right" Aligns the xoffset to the right side of the image.
"middle" Aligns the xoffset to the middle of the image.
"bbox_left" Aligns the xoffset to the bounding box left side of the image.
"bbox_right" Aligns the xoffset to the bounding box right side of the image.

yoffset

Key Explanation
"top" Aligns the yoffset to the top side of the image.
"bottom" Aligns the yoffset to the bottom side of the image.
"middle" Aligns the yoffset to the middle of the image.
"bbox_top" Aligns the yoffset to the bounding box top side of the image.
"bbox_bottom" Aligns the yoffset to the bounding box bottom side of the image.

speed_type

Key Explanation
frame_per_second A image frame renders X per 1 second
frame_per_game_frame A image frame renders X per game frame

bbox_mode

Key Explanation
automatic The bbox calculation is automatic, based on the pixel alpha.
fullimage The bbox calculation should use the full image size.
manual The bbox calculation is manually defined.

bbox_kind

Key Explanation
rectangular The bbox calculation will make a box-shaped collision
ellipse The bbox calculation will make a ellipse-shaped collision
diamond The bbox calculation will make a diamond-shaped collision
precise The bbox calculation will match exactly per pixel alpha. See tolerance for the tolerance amount.

Example format:

{
	name: "spr_player_car_volvo240_body_white"
	xoffset: 0
	yoffset: 0
	tag: "skin"
	speed_type: "frame_per_second"
	speed: 2
	bbox_kind: "precise"
	tolerance: 128
}