Project Outline
 
gbox
addAudio(id, filename, def)
addBundle(call)
addFont(data)
addImage(id, filename)
addObject(data)
addScript(call)
blit(tox, image, data)
blitAll(tox, image, data)
blitClear(image, data)
blitFade(tox, data)
blitRect(tox, data)
blitText(tox, data)
blitTile(tox, data)
blitTilemap(tox, data)
centerCamera(data, viewdata)
collides(o1, o2, t)
createCanvas(id, data)
dataLoad(k, a)
dataSave(k, v, d)
getObject(group, id)
go()
hitAudio(a, data)
log()
pixelcollides(o1, o2, t)
playAudio(a, data)
readBundleData(pack, call)
setCameraX(x, viewdata)
setCameraY(y, viewdata)
setZindex(th, z)
stopAudio(a, permissive)
trashGroup(group)
 
help
asciiArtToMap(map, tra)
copyModel(data, model)
createModel(obj, attrs)
decideFrame(cnt, anim)
decideFrameOnce(cnt, anim)
framestotime(frames)
getArrayIndexed(a, value, field)
getTileInMap(x, y, map, ifout, mapid)
isLastFrameOnce(cnt, anim)
isSquished(th, by)
limit(v, min, max)
mergeWithModel(data, model)
multiplier(v, mul)
postpad(str, len, pad)
prepad(str, len, pad)
random(min, range)
seq(st, ed, skip)
setTileInMap(ctx, map, x, y, tile, The)
upAndDown(counter, max)
xPixelToTile(map, x, gap)
xPixelToTileX(map, x, gap)
yPixelToTile(map, y, gap)
yPixelToTileY(map, y, gap)
controlKeys(th, keys)
fireBullet(gr, id, data)
generateEnemy(gr, id, data, model)
generateScroller(gr, id, data)
hitByBullet(th, by)
initialize(th, data)
spawn(th, data)
after(th, id, frames)
every(th, id, frames)
randomly(th, id, data)
real(th, id, data)
 
tool
makecels(data)
callInColliding(th, data)
collides(fr, to, t)
controlKeys(th, keys)
fireBullet(gr, id, data)
floorCollision(th, data)
getAheadPixel(th, data)
initialize(th, data)
makedoor(gr, id, map, data)
pixelcollides(fr, to, t)
setStaticSpeed(th, speed)
spawn(th, data)
tileCollision(th, map, tilemap, defaulttile, data)
wander(th, map, tilemap, defaulttile, data)
addAngle(a, add)
getAngle(p1, p2, transl)
getDistance(p1, p2)
translate(p1, a, d)
translateX(x1, a, d)
translateY(y1, a, d)
«
Akihabara Framework

Namespace trigo

Trigo module provides some math stuff for moving objects in a direction or following a round path.

Defined in: trigo.js.

Method Summary
addAngle(a, add) Adds two angles together (radians).
getAngle(p1, p2, transl) Calculates the angle between two points.
getDistance(p1, p2) Gets the distance between two points.
translate(p1, a, d) Translates a point by a vector defined by angle and distance. This does not return a value but rather modifies the x and y values of p1.
translateX(x1, a, d) Translates an x component of a coordinate by a vector defined by angle and distance. This returns its component translation.
translateY(y1, a, d) Translates a y component of a coordinate by a vector defined by angle and distance. This returns its component translation.
Method Detail
trigo.addAngle(a, add)
Adds two angles together (radians).

										
									
Parameters:
{Float} a Base angle.
{Float} add The angle you're adding to the base angle.
Returns:
The resultant angle, always between 0 and 2*pi.
trigo.getAngle(p1, p2, transl)
Calculates the angle between two points.

										
									
Parameters:
{Object} p1 This is an object containing x and y params for the first point.
{Object} p2 This is an object containing x and y params for the second point.
{Float} transl (Optional) Adds an angle (in radians) to the result. Defaults to 0.
Returns:
The angle between points p1 and p2, plus transl.
trigo.getDistance(p1, p2)
Gets the distance between two points.

										
									
Parameters:
{Object} p1 This is an object containing x and y params for the first point.
{Object} p2 This is an object containing x and y params for the second point.
Returns:
The distance between p1 and p2.
trigo.translate(p1, a, d)
Translates a point by a vector defined by angle and distance. This does not return a value but rather modifies the x and y values of p1.

										
									
Parameters:
{Object} p1 This is an object containing x and y params for the point.
{Float} a The angle of translation (rad).
{Float} d The distance of translation.
trigo.translateX(x1, a, d)
Translates an x component of a coordinate by a vector defined by angle and distance. This returns its component translation.

										
									
Parameters:
{Float} x1 This is an x coordinate.
{Float} a The angle of translation (rad).
{Float} d The distance of translation.
trigo.translateY(y1, a, d)
Translates a y component of a coordinate by a vector defined by angle and distance. This returns its component translation.

										
									
Parameters:
{Float} y1 This is a y coordinate.
{Float} a The angle of translation (rad).
{Float} d The distance of translation.
Documentation generated by JsDoc Toolkit 2.3.2 on Wed Aug 18 2010 16:00:44 GMT-0400 (EDT)