JS Render Kit

This API reference allows you to build high performance components using sprites, 3D models and more

Global

Methods


createComponent(obj, className, x1, y1, x2, y2)

createComponent creates an instance of the className ComponentString inside your custom component, positioned at x1% from the left, x2% from the right,
y1% from the top and y2% from the bottom. The width and height of the component is automatically calculated based on the points provided.
Parameters:
Name Type Description
obj

object

the custom component or sub component you have created under which the component will be created.
className

string

the string name of the component class to create. Can use the ComponentString to find the names
x1

number

the percent width to offset from the left edge of the parent component
y1

number

the percent height to offset from the top edge of the parent component
x2

number

the percent width to offset from the right edge of the parent component
y2

number

the percent width to offset from the bottom edge of the parent component
Returns:
– a reference to the newly created component (or 0 if there is an error)
Type

object

Example
//create a new renderkit component during initialisation of the custom component
function my_init(width, height){
	var rk = createComponent(self, "renderkit", 0, 0, 100, 100)
}

renderkitCameraSetGround(renderkit, color)

renderkitCameraSetGround sets the ground plane color. This is a plane which cuts the origin and the y axis is the upvector
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
color

string

The full 32 bit color representation including alpha (opaque white = 0xFFFFFFFF)

renderkitCameraSetPano(renderkit, filename)

renderkitCameraSetPano sets the environment with a type of skybox known as a panosphere or spherical panorama (rather than 6 seperate images)
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
filename

string

The panosphere image to use

renderkitCameraUpdateEye(renderkit, x, y, z)

renderkitCameraUpdateEye this describes the eye position in world space. This is where the camera will start looking from.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
x

real

y

real

z

real


renderkitCameraUpdateEyeTween(renderkit, x, y, z, ms, type)

renderkitCameraUpdateEyeTween this animates the eye position in world space. This is where the camera will start looking from.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitCameraUpdateFOV(renderkit, fov)

renderkitCameraUpdateFOV sets the field of view of the camera. This is the angle describing how much of the world the camera can see.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
fov

real

90 is a comfortable FOV for a device. 60 is a zoom and 120 is a wide angle view which will start to show distortion.

renderkitCameraUpdateFrustrum(renderkit, near, far)

renderkitCameraUpdateFrustrum this adjusts the range of the clipping and zbuffer accuracy. This can be managed to closely match the scale of the world so the zbuffer on mobile devices is used to best effect.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
near

real

the closest point for calculating the z buffer e.g. 0.01
far

real

the furthest point for calculating the z buffer e.g. 100

renderkitCameraUpdateLookat(renderkit, x, y, z)

renderkitCameraUpdateLookat this describes the lookat position in world space. This is where the camera will look at.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
x

real

y

real

z

real


renderkitCameraUpdateLookatTween(renderkit, x, y, z, ms, type)

renderkitCameraUpdateLookatTween this animates the lookat position in world space. This is where the camera will look at.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitCameraUpdateUpvector(renderkit, x, y, z)

renderkitCameraUpdateUpvector this describes the rotation of the camera along its axis, e.g. the direction which is up. This is usually kept with the y axis being up, but can be altered for rolling and pitching the camera.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
x

real

y

real

z

real


renderkitCleanup(renderkit)

renderkitCleanup cleans up and removes any shapes, sprites, maps or models
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to cleanup

renderkitLightUpdateColor(renderkit, lightid, color)

renderkitLightUpdateColor this sets the light color.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0, 1 or 2 (note : only some shaders use the lights)
color

string

The full 32 bit color representation including alpha (opaque white = 0xFFFFFFFF)

renderkitLightUpdateColorTween(renderkit, lightid, color, ms, type)

renderkitLightUpdateColorTween this animates the light color over time
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0,1 or 2 (note : only some shaders use the lights)
color

string

The full 32 bit color representation including alpha (opaque white = 0xFFFFFFFF)
ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitLightUpdateDir(renderkit, lightid, x, y, z)

renderkitLightUpdateDir this updates the light direction.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0, 1 or 2 (note : only some shaders use the lights)
x

real

y

real

z

real


renderkitLightUpdateDirTween(renderkit, lightid, x, y, z, ms, type)

renderkitLightUpdateDirTween this animates the light direction.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0, 1 or 2 (note : only some shaders use the lights)
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitLightUpdatePos(renderkit, lightid, x, y, z)

renderkitLightUpdatePos this describes the eye position in world space. This is where the camera will start looking from.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0, 1 or 2 (note : only some shaders use the lights)
x

real

y

real

z

real


renderkitLightUpdatePosTween(renderkit, lightid, x, y, z, ms, type)

renderkitLightUpdatePosTween this animates the eye position in world space. This is where the camera will start looking from.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit object to adjust
lightid

int

Valid light ID’s are 0, 1 or 2 (note : only some shaders use the lights)
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitMapGetTileCol(renderkit, map_idx, x)

renderkitMapGetTileCol returns the col of tiles the x value lines up with (allowing for the last renderkitMapRender).
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
map_idx

int

The map index from the pool of maps
x

real

The x position in the current map to examine
Returns:
col – returns the column of the map which the x falls into
Example
var row = renderkitMapGetTileRow(self, 0, y);
var col = renderkitMapGetTileCol(self, 0, x);
var tileid = renderkitMapGetTileID(self, 0, row, col));

renderkitMapGetTileID(renderkit, map_idx, row, col)

renderkitMapGetTileID returns the tile index for that item in the map for a given row and column
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
map_idx

int

The map index from the pool of maps
row

int

the row of the tile to retrieve
col

int

the column of the tile to retrieve
Returns:
tile_idx – returns the tile index from the map given the row and column to examine
Example
var row = renderkitMapGetTileRow(self, 0, y);
var col = renderkitMapGetTileCol(self, 0, x);
var tileid = renderkitMapGetTileID(self, 0, row, col));

renderkitMapGetTileRow(renderkit, map_idx, y)

renderkitMapGetTileRow returns the row of tiles the y value lines up with (allowing for the last renderkitMapRender).
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
map_idx

int

The map index from the pool of maps
y

real

The y position in the current map to examine
Returns:
row – returns the row of the map which the y falls into
Example
var row = renderkitMapGetTileRow(self, 0, y);
var col = renderkitMapGetTileCol(self, 0, x);
var tileid = renderkitMapGetTileID(self, 0, row, col));

renderkitMapLoad(renderkit, filename, gscale, width, height, row_height, col_width)

renderkitMapLoad adds a new map to the pool of hardware accelerated maps in the renderkit component. This map allocates it’s own set of sprites from the pool of sprites in the renderkit.
You can load multiple maps to provide paralax layering.
Note : The map format is a simple binary format. See the demo applications for more information on making your own maps and spritesheets.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
filename

string

The name of the map file in the images folder of your project
gscale

real

The scale of the map as a ratio (1.0 is the default)
width

int

The width of the map area in pixels
height

int

The height of the map area in pixels
row_height

int

The height of each row of sprites in pixels
col_width

int

The width of each column of sprites in pixels
Returns:
map_idx – the map index in the pool of maps
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100)
setProperty(rk,"spritesheet","sprites");
renderkitMapLoad(rk,'desert.map',1.0,width,height,128,128);

renderkitMapRender(renderkit, map_idx, x, y)

renderkitMapRender renders the map tiles/sprites at the specified x,y offset from it’s origin
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to render from
map_idx

int

The map index from the pool of maps
x

real

The x offset from the origin (top left) of the map
y

real

The y offset from the origin (top left) of the map
Example
function gamemap_on_move(x, y, tid){
	renderkitMapRender(self, map_idx, mx, my)
}

renderkitModelAnimGetLength(renderkit, modelid)

renderkitModelAnimGetLength returns the length of the current animation on a model_animated
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
Returns:
length – the length of the animation in milliseconds

renderkitModelAnimPlay(renderkit, modelid, animation, blend_time, looping)

renderkitModelAnimPlay play an animation on a model_animated (these are named animations created in the 3D animation package before they are exported to be used in Umajin)
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
animation

string

name – the name of one of potentially multiple skeletal animations inside the model_animated
blend_time

int

the number of ms to blend between the previous playing animation to this new animation
looping

int

0 for no loop, 1 to loop the animation continuously

renderkitModelAnimSeek(renderkit, modelid, time)

renderkitModelAnimSeek seek to a specific time in an animation on a model_animated
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
time

int

the time to seek into the animation in ms

renderkitModelAnimTempo(renderkit, modelid, tempo_ratio)

renderkitModelAnimTempo adjust the speed of animation playback on a model_animated when renderkitModelAnimPlay is called
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
tempo_ratio

int

the speed for playback (normally 1.0)

renderkitModelClearQuads(renderkit, modelid)

renderkitModelClearQuads clears the quads.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool

renderkitModelClearTriangles(renderkit, modelid)

renderkitModelClearTriangles clears the triangles.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool

renderkitModelCount(renderkit)

renderkitModelCount returns the model count from the renderkit
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to examine
Returns:
count – returns the model count

renderkitModelCreate(renderkit, type, filename)

renderkitModelCreate adds a new model to the pool of hardware accelerated elements.
This can be a model, a model_animated, an image, a sphere or custom. Custom requires you to then create quads or triangles to make the model.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to add the model into
type

string

The type of model (model, model_animated, image or sphere)
filename

string

The model filename or texture to load. Note: these files must be placed in the model_3d resources folder
Returns:
model_idx – the model index in the pool of models
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
var id = renderkitModelCreate(rk, "sphere", "worldmap.jpg");

renderkitModelCreateQuad(renderkit, modelid, x1,y1,z1,u1,v1,c1, x2,y2,z2,u2,v2,c2, x3,y3,z3,u3,v3,c3, x4,y4,z4,u4,v4,c3)

renderkitModelCreateQuad create a basic quad with texture. This requires you to first use renderkitModelCreate with the type ‘custom’. Normals are automatically created using the face normal.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x1,y1,z1,u1,v1,c1

real

first vertex position, texture coordinates and RGBA color as an integer
x2,y2,z2,u2,v2,c2

real

second vertex position, texture coordinates and RGBA color as an integer
x3,y3,z3,u3,v3,c3

real

third vertex position, texture coordinates and RGBA color as an integer
x4,y4,z4,u4,v4,c3

real

fourth vertex position, texture coordinates and RGBA color as an integer

renderkitModelCreateQuadFull(renderkit, modelid, x1,y1,z1,u1,v1,nx1,ny1,nz1,color, x2,y2,z2,u2,v2,nx2,ny2,nz2,color, x3,y3,z3,u3,v3,nx3,ny3,nz3,color, x4,y4,z4,u4,v4,nx4,ny4,nz4,color)

renderkitModelCreateQuadFull create a quad with texture, normals and color. This requires you to first use renderkitModelCreate with the type ‘custom’.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x1,y1,z1,u1,v1,nx1,ny1,nz1,color

real

first vertex position, texture coordinates, normal and RBGA color as an integer
x2,y2,z2,u2,v2,nx2,ny2,nz2,color

real

second vertex position, texture coordinates, normal and RBGA color as an integer
x3,y3,z3,u3,v3,nx3,ny3,nz3,color

real

third vertex position, texture coordinates, normal and RBGA color as an integer
x4,y4,z4,u4,v4,nx4,ny4,nz4,color

real

fourth vertex position, texture coordinates, normal and RBGA color as an integer

renderkitModelCreateTriangle(renderkit, modelid, x1,y1,z1,u1,v1,c1, x2,y2,z2,u2,v2,c2, x3,y3,z3,u3,v3,c3)

renderkitModelCreateTriangle create a basic triangle with texture. This requires you to first use renderkitModelCreate with the type ‘custom’. Normals are automatically created using the face normal.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x1,y1,z1,u1,v1,c1

real

first vertex position, texture coordinates and RGBA color as an integer
x2,y2,z2,u2,v2,c2

real

second vertex position, texture coordinates and RGBA color as an integer
x3,y3,z3,u3,v3,c3

real

vertex position, texture coordinates and RGBA color as an integer

renderkitModelCreateTriangleFull(renderkit, modelid, x1,y1,z1,u1,v1,nx1,ny1,nz1,color, x2,y2,z2,u2,v2,nx2,ny2,nz2,color, x3,y3,z3,u3,v3,nx3,ny3,nz3,color)

renderkitModelCreateTriangleFull create a triangle with texture, normals and color. This requires you to first use renderkitModelCreate with the type ‘custom’.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x1,y1,z1,u1,v1,nx1,ny1,nz1,color

real

first vertex position, texture coordinates, normal and RBGA color as an integer
x2,y2,z2,u2,v2,nx2,ny2,nz2,color

real

second vertex position, texture coordinates, normal and RBGA color as an integer
x3,y3,z3,u3,v3,nx3,ny3,nz3,color

real

third vertex position, texture coordinates, normal and RBGA color as an integer

renderkitModelUpdateAngle(renderkit, modelid, x, y, z)

renderkitModelUpdateAngle change the x,y,z angle of a model.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real


renderkitModelUpdateAngleTween(renderkit, modelid, x, y, z, ms, type)

renderkitModelUpdateAngleTween change the x,y,z angle of a model over time
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitModelUpdateEffect(renderkit, modelid, effect)

renderkitModelUpdateEffect change the GPU effect applied to the model
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
effect

string

The effect to apply (this is a GPU shader, several of which are supplied with Umajin)

renderkitModelUpdateFilename(renderkit, modelid, filename)

renderkitModelUpdateFilename change the filename applied to the model
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
filename

string

The filename to apply (where appropriate)

renderkitModelUpdateOrigin(renderkit, modelid, x, y, z)

renderkitModelUpdateOrigin change the x,y,z origin of a model.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real


renderkitModelUpdateOriginTween(renderkit, modelid, x, y, z, ms, type)

renderkitModelUpdateOriginTween change the x,y,z origin of a model over time
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitModelUpdatePosition(renderkit, modelid, x, y, z)

renderkitModelUpdatePosition change the x,y,z position of a model.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real


renderkitModelUpdatePositionTween(renderkit, modelid, x, y, z, ms, type)

renderkitModelUpdatePositionTween change the x,y,z position of a model over time
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitModelUpdateQuadFull(renderkit, modelid, quadid, x1,y1,z1,u1,v1,nx1,ny1,nz1,color, x2,y2,z2,u2,v2,nx2,ny2,nz2,color, x3,y3,z3,u3,v3,nx3,ny3,nz3,color, x4,y4,z4,u4,v4,nx4,ny4,nz4,color)

renderkitModelUpdateQuadFull updates a quad with texture, normals and color. This requires you to first use renderkitModelCreate with the type ‘custom’.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
quadid

int

The index in the quad pool
x1,y1,z1,u1,v1,nx1,ny1,nz1,color

real

first vertex position, texture coordinates, normal and RBGA color as an integer
x2,y2,z2,u2,v2,nx2,ny2,nz2,color

real

second vertex position, texture coordinates, normal and RBGA color as an integer
x3,y3,z3,u3,v3,nx3,ny3,nz3,color

real

third vertex position, texture coordinates, normal and RBGA color as an integer
x4,y4,z4,u4,v4,nx4,ny4,nz4,color

real

fourth vertex position, texture coordinates, normal and RBGA color as an integer

renderkitModelUpdateScale(renderkit, modelid, x, y, z)

renderkitModelUpdateScale change the x,y,z scale of a model. (scale is a ratio so 1.0 is no change, 0.5 = half and 2.0 = double)
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real


renderkitModelUpdateScaleTween(renderkit, modelid, x, y, z, ms, type)

renderkitModelUpdateScaleTween change the x,y,z scale of a model over time
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
x

real

y

real

z

real

ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitModelUpdateShaderUniform(renderkit, modelid, id, value)

renderkitModelUpdateShaderUniform set a shader uniform – this requires an effect to be assigned which can utilise this value
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
id

int

this is which uniform in the effect shader to access (0=shader_uniform2.x, 1=shader_uniform2.y, 2=shader_uniform2.z, 3=shader_uniform2.w)
value

real

the value

renderkitModelUpdateShaderUniformTween(renderkit, modelid, id, value, ms, type)

renderkitModelUpdateShaderUniformTween animate a shader uniform – this requires an effect to be assigned which can utilise this value
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
id

int

this is which uniform in the effect shader to access (0=shader_uniform2.x, 1=shader_uniform2.y, 2=shader_uniform2.z, 3=shader_uniform2.w)
value

real

the value
ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitModelUpdateTriangleFull(renderkit, modelid, triangleid, x1,y1,z1,u1,v1,nx1,ny1,nz1,color, x2,y2,z2,u2,v2,nx2,ny2,nz2,color, x3,y3,z3,u3,v3,nx3,ny3,nz3,color)

renderkitModelUpdateTriangleFull updates a triangle with texture, normals and color. This requires you to first use renderkitModelCreate with the type ‘custom’.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the model
modelid

int

The index in the model pool
triangleid

int

The index in the triangle pool
x1,y1,z1,u1,v1,nx1,ny1,nz1,color

real

first vertex position, texture coordinates, normal and RBGA color as an integer
x2,y2,z2,u2,v2,nx2,ny2,nz2,color

real

second vertex position, texture coordinates, normal and RBGA color as an integer
x3,y3,z3,u3,v3,nx3,ny3,nz3,color

real

third vertex position, texture coordinates, normal and RBGA color as an integer

renderkitShapeClear(renderkit, shape_idx)

renderkitShapeClear clears the surface of the shape but does not alter it’s current position, angle or tint.
Once a shape has been cleared you can draw on it again using renderkitShapeDraw, renderkitShapeDoMove, renderkitShapeDoLine and renderkitShapeDoSpline.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
Example
renderkitShapeClear(rk, shape_idx);
renderkitShapeDoMove(rk, shape_idx, 0, 0);
renderkitShapeDoLine(rk, shape_idx, 20, 20);

renderkitShapeCount(renderkit)

renderkitShapeCount returns the shape count from the renderkit
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to examine
Returns:
count – returns the shape count

renderkitShapeCreate(renderkit, command)

renderkitShapeCreate returns the shape index for the new shape from the pool of shapes in the renderkit
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to add the shape
command

string

The optional SVG style shape command, see renderkitShapeDraw
Returns:
shape_idx – returns the shape index from pool of shapes in the renderkit
Example
var shape_idx = renderkitShapeCreate(rk, "M 45.673,0 L 67.781,0");

renderkitShapeDoClose(renderkit, shape_idx)

renderkitShapeDoClose closes up the current shape so it can be completed or filled.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
Example
renderkitShapeClear(rk, shape_idx);
renderkitShapeDoMove(rk, shape_idx, 0, 0);
//draw a triangle
renderkitShapeDoLine(rk, shape_idx, 20, 20);
renderkitShapeDoLine(rk, shape_idx, 0, 20);
renderkitShapeDoClose(rk, shape_idx);

renderkitShapeDoLine(renderkit, shape_idx, x, y)

renderkitShapeDoLine draws a line from the current pen position to the new absolute x,y on a shape.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
Examples
renderkitShapeClear(rk, shape_idx);
renderkitShapeDoMove(rk, shape_idx, 0, 0);
renderkitShapeDoLine(rk, shape_idx, 20, 20);
function rk_shape_draw(rk){
	// check size of renderkit in local units
	var width = getProperty(rk, "width");
	var height2 = getProperty(rk, "height") / 2.0;
	
	// clear the shape
	renderkitShapeClear(rk,0)
	
	//setup the start of the curve
	var y = height2 + Math.sin((a / 3.0)) * height2
	renderkitShapeDoMove(rk,0,y,50)
	
	// draw the lines of a sin curve
	for (var a = 0; a < 51; a++){
		var y = height2 + Math.sin((a / 5.0)) * height2
		renderkitShapeDoLine(rk,0,a * width / 50.0, y)
	}
}

renderkitShapeDoMove(renderkit, shape_idx, x, y)

renderkitShapeDoMove moves the current pen on a shape to a new absolute x,y location ready for the next line or spline command.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
Example
renderkitShapeClear(rk, shape_idx);
renderkitShapeDoMove(rk, shape_idx, 0, 0);
renderkitShapeDoLine(rk, shape_idx, 20, 20);

renderkitShapeDoSpline(renderkit, shape_idx, x, y, c1x, c1y, c2x, c2y)

renderkitShapeDoSpline draws a spline from the current pen position to the new absolute x,y on a shape using the 4 control points to define the shape of the curve.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
c1x

real

The first control point x position
c1y

real

The first control point y position
c2x

real

The second control point x position
c2y

real

The second control point y position
Example
renderkitShapeClear(rk, shape_idx);
renderkitShapeDoMove(rk, shape_idx, 0, 0);
renderkitShapeDoSpline(rk, shape_idx, 20, 20, 10, 10, 30, 30);

renderkitShapeDoStrokeWidth(renderkit, shape_idx, width)

renderkitShapeDoStrokeWidth as you are drawing lines and splines this will adjust the line width as a multiple of renderkitShapeStrokeWidth
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
width

real

the new line width mutiplier

renderkitShapeDoWedge(renderkit, shape_idx, x,y, inner_radius,outer_radius, startangle,endangle)

renderkitShapeDoWedge draws a wedge with an inner and outer radius at the nominated x,y position
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x,y

int

The position for the center of the wedge
inner_radius,outer_radius

real

The inner and outer radius. An inner_radius of 0 draws a full wedge
startangle,endangle

real

The start and end angle in degrees for the wedge

renderkitShapeDraw(renderkit, shape_idx, command)

renderkitShapeDraw creates shapes using an SVG style string format. Stroke caps are 0:butt, 1:round, 2:square. Join types are 0:bevel, 1:round, 2:mitre, 3:none.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
command

string

The M (move absolute), m (move relative), L (doLine absolute), C x1,y1 x2,y2, x,y (doSpline absolute - note : this should be a cubic bezier in SVG) Umajin also supports R for Rect x1 y1 x2 y2, W for overall line width, w to multiply line with as we draw, n for line color, f for fill color, F [bool] to determine if the closure is filled, p for stroke cap, j for stroke join
Examples
// basic black horizontal line
renderkitShapeDraw(rk, id, "M 0,0 L 100,0");
// filled with dark red, a bright red 3 pixel width stroke forming a wide rectangle
renderkitShapeDraw(rk, id, "F 1 f 0x0660000FF n 0xFF0000FF W 3 R 0 0 400 200");
// two part spline with an increasing diameter line
renderkitShapeDraw(rk, id, "W 2 w 1 M 0,50 C 0,0 100,0 100,50 w 3 C 100,0 200,100 200,50");

renderkitShapeFillColor(renderkit, shape_idx, clr)

renderkitShapeFillColor sets the fill colour for shapes which have been renderkitShapeFilled
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
clr

real

the new fill color e.g. 0x002233FF

renderkitShapeFilled(renderkit, shape_idx, flag)

renderkitShapeFilled sets if the shape should be filled or not, the color is determined by renderkitShapeFillColor
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
flag

bool

if the shape is filled or not

renderkitShapeStrokeColor(renderkit, shape_idx, clr)

renderkitShapeStrokeColor as you are drawing lines and splines this is the stroke color which will be used.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
clr

real

the new fill color e.g. 0x002233FF

renderkitShapeStrokeWidth(renderkit, shape_idx, width)

renderkitShapeStrokeWidth sets the basic width of the stroke for any lines or splines being drawn
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
width

real

the width of the stroke is in pixels (0 or 1 is hairline)

renderkitShapeUpdate(renderkit, shape_idx, x, y, origin_x, origin_y, scale, angle, color)

renderkitShapeUpdate does not alter the shape commands, but allows the hardware accelerated shape to be moved, scaled and tinted inside the renderkit
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
origin_x

real

The x origin
origin_y

real

The y origin
scale

real

The scale of the shape as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
color

int

The full 32 bit color tint including alpha (opaque white = 0xFFFFFFFF)
Example
renderkitShapeUpdate(rk, shape_idx, x, y, 0, 0, 1.0, 45, 0xFFFFFFFF);

renderkitShapeUpdateEffect(renderkit, shapeid, effect)

renderkitShapeUpdateEffect change the GPU effect applied to the shape
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the shape
shapeid

int

The index in the shape pool
effect

string

The effect to apply (this is a GPU shader, several of which are supplied with Umajin)

renderkitShapeUpdateIn(renderkit, shape_idx, x, y, origin_x, origin_y, scale, angle, color, ms)

renderkitShapeUpdateIn does not alter the shape commands, but allows the hardware accelerated shape to be moved, scaled and tinted inside the renderkit after a time delay in milliseconds
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
origin_x

real

The x origin
origin_y

real

The y origin
scale

real

The scale of the shape as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
color

int

The full 32 bit color tint including alpha (opaque white = 0xFFFFFFFF)
ms

int

The delay in milliseconds
Example
renderkitShapeUpdateIn(rk, shape_idx, x, y, 0, 0, 1.0, 45, 0xFFFFFFFF, 100);

renderkitShapeUpdateInTween(renderkit, shape_idx, x, y, origin_x, origin_y, scale, angle, color, ms, tween)

renderkitShapeUpdateInTween does not alter the shape commands, but allows the hardware accelerated shape to be moved, scaled and tinted inside the renderkit and animated over a time in milliseconds
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
shape_idx

int

The shape index from the pool of shapes in the renderkit
x

real

The x position
y

real

The y position
origin_x

real

The x origin
origin_y

real

The y origin
scale

real

The scale of the shape as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
color

int

The full 32 bit color tint including alpha (opaque white = 0xFFFFFFFF)
ms

int

The delay in milliseconds
tween

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine
Example
renderkitShapeUpdateInTween(rk, shape_idx, x, y, 0, 0, 1.0, 45, 0xFFFFFFFF, 100, 1);

renderkitShapeUpdateShaderTexture(renderkit, shapeid, texture)

renderkitShapeUpdateShaderTexture change the texture for the shader
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the shape
shapeid

int

The index in the shape pool
texture

string

The filename of the texture to apply

renderkitShapeUpdateShaderUniform(renderkit, modelid, id, value)

renderkitShapeUpdateShaderUniform set a shader uniform - this requires an effect to be assigned which can utilise this value
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the shape
modelid

int

The index in the shape pool
id

int

this is which uniform in the effect shader to access (0=shader_uniform2.x, 1=shader_uniform2.y, 2=shader_uniform2.z, 3=shader_uniform2.w)
value

real

the value

renderkitShapeUpdateShaderUniformTween(renderkit, shapeid, id, value, ms, type)

renderkitShapeUpdateShaderUniformTween animate a shader uniform - this requires an effect to be assigned which can utilise this value
Parameters:
Name Type Description
renderkit

renderkit

The renderkit containing the shape
shapeid

int

The index in the shape pool
id

int

this is which uniform in the effect shader to access (0=shader_uniform2.x, 1=shader_uniform2.y, 2=shader_uniform2.z, 3=shader_uniform2.w)
value

real

the value
ms

int

the number of milliseconds for the tween
type

int

The allowable values of tween are 0:none, 1:linear, 2:ease_in, 3:ease_out, 4:ease_both, 5:ease_rev, 6:cubic_in, 7:cubic_out, 8:cubic_in_out, 9:cubic_out_in, 10:ease_in_strong, 11:ease_out_strong, 12:ease_both_strong, 13:ease_both_strong_rev ,14:quint_in, 15:quint_out, 16:quint_in_out, 17:quint_out_in, 18:sine_in, 19:sine_out, 20:sine_in_out, 21:sine_out_in, 22:expo_in, 23:expo_out, 24:expo_in_out, 25:expo_out_in, 26:circ_in, 27:circ_out, 28:circ_in_out, 29:circ_out_in, 30:elastic_in, 31:elastic_out, 32:elastic_in_out, 33:elastic_out_in, 32:elastic_both, 34:back_in, 35:back_out, 36:back_in_out, 37:back_out_in, 36:back_both, 38:bounce_in, 39:bounce_out, 40:bounce_in_out, 41:bounce_out_in, 40:bounce_both, 42:simplex16, 43:curve_in, 44:curve_out, 45:curve_sine, 46:curve_cosine

renderkitSpriteCount(renderkit)

renderkitSpriteCount returns the sprite count from the renderkit
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to examine
Returns:
count - returns the sprite count

renderkitSpriteCreate(renderkit, cellid, imagename, x, y, scale, angle, alpha)

renderkitSpriteCreate adds a new sprite to the pool of hardware accelerated sprites in the renderkit component.
Note : The sprite sheet format is the same used by both Spine and libGDX. Please see the demo applications for more information on making your own spritesheets.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit to add the sprite to
cellid

int

The cell index in the spritesheet(-1 if you want to use the name)
imagename

string

The sprite name in the spritesheet (only checked if the cellid is -1)
x

real

The x position
y

real

The y position
scale

real

The scale of the sprite as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
alpha

int

The transparency of the sprite (0 = transparent, 255 = opaque)
Returns:
sprite_idx - the sprite index in the pool of sprites
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
setProperty(rk,"spritesheet","sprites");
var id = renderkitSpriteCreate(rk, 1, '', 50, 50, 1, 0, 255);

renderkitSpriteGetHeight(renderkit, cellid, imagename)

renderkitSpriteGetHeight returns the height of a sprite from the spritesheet in pixels
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
cellid

int

The cell index in the spritesheet(-1 if you want to use the name)
imagename

string

The sprite name in the spritesheet (only checked if the cellid is -1)
Returns:
sprite_height - the height of the sprite
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
setProperty(rk,"spritesheet","sprites");
var cell1height = renderkitSpriteGetHeight(rk, 1, '');

renderkitSpriteGetWidth(renderkit, cellid, imagename)

renderkitSpriteGetWidth returns the width of a sprite from the spritesheet in pixels
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
cellid

int

The cell index in the spritesheet(-1 if you want to use the name)
imagename

string

The sprite name in the spritesheet (only checked if the cellid is -1)
Returns:
sprite_width - the width of the sprite
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
setProperty(rk,"spritesheet","sprites");
var cell1width = renderkitSpriteGetWidth(rk, 1, '');

renderkitSpriteUpdate(renderkit, id, cellid, imagename, x, y, scale, angle, alpha)

renderkitSpriteUpdate updates a sprite which has been created using renderkitSpriteCreate in the renderkit component.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
id

int

The sprite index from the pool of sprites in the renderkit
cellid

int

The cell index in the spritesheet(-1 if you want to use the name)
imagename

string

The sprite name in the spritesheet (only checked if the cellid is -1)
x

real

The x position
y

real

The y position
scale

real

The scale of the sprite as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
alpha

int

The transparency of the sprite (0 = transparent, 255 = opaque)
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
setProperty(rk,"spritesheet","sprites");
var id = renderkitSpriteCreate(rk, 1, '', 50, 50, 1, 0, 255);
renderkitSpriteUpdate(rk, id, 1, '', 100, 100, 1, 90, 255);

renderkitSpriteUpdateFull(renderkit, id, cellid, imagename, x, y, x_scale, y_scale, angle, color)

renderkitSpriteUpdateFull updates a sprite which has been created using renderkitSpriteCreate in the renderkit component with fully detailed properties.
Parameters:
Name Type Description
renderkit

renderkit

The renderkit being used
id

int

The sprite index from the pool of sprites in the renderkit
cellid

int

The cell index in the spritesheet(-1 if you want to use the name)
imagename

string

The sprite name in the spritesheet (only checked if the cellid is -1)
x

real

The x position
y

real

The y position
x_scale

real

The x scale of the sprite as a ratio (1.0 is the default)
y_scale

real

The y scale of the sprite as a ratio (1.0 is the default)
angle

real

The angle of rotation in degrees (0 - 360)
color

int

The full 32 bit color representation including alpha (opaque white = 0xFFFFFFFF)
Example
var rk = createComponent(self, "renderkit", 0, 0, 100, 100);
setProperty(rk,"spritesheet","sprites");
var id = renderkitSpriteCreate(rk, 1, '', 50, 50, 1, 0, 255);
renderkitSpriteUpdate(rk, id, 1, '', 100, 100, 1, 1.2, 90, 0x002233FF);