00:00
00:00
Newgrounds Background Image Theme

PalmVoe just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Foss: Apilib 2005-07-27 09:29:35


FOSS: Main

Post here any useful API functions to be included in our API library, I'll start by two that draw rectangles, please add your own to make API easier for people :)

//common API module by Inglor, Inglor@gmail.com
//made for Newgrounds.com

/*
functions:
rectangle(startx, starty,endx,endy,color,reference)
GETS: startx and starty : the starting point of the rectangle
endx and endy: the ending point of the rectangle
color: the color of the rectangle in HEX format
reference: a reference to the cllip to draw the rectangle in
RETS: the reference

rectanglea(startx, starty,endx,endy,color, alpha, reference)
GETS: startx and starty : the starting point of the rectangle
endx and endy: the ending point of the rectangle
color: the color of the rectangle in HEX format
alpha: the alpha value of the rectangle
reference: a reference to the cllip to draw the rectangle in
RETS: the reference

*/
function rectangle(x, y, ex, ey, col, ref) {
ref.lineStyle(1, 0x00000, 0);
ref.beginFill(col, 100);
ref.moveTo(x, y);
ref.lineTo(ex, y);
ref.lineTo(ex, ey);
ref.lineTo(x, ey);
ref.lineTo(x, y);
}

function rectangle(x, y, ex, ey, col, a, ref) {
ref.lineStyle(1, 0x00000, 0);
ref.beginFill(col, a);
ref.moveTo(x, y);
ref.lineTo(ex, y);
ref.lineTo(ex, ey);
ref.lineTo(x, ey);
ref.lineTo(x, y);
return ref;
}

Response to Foss: Apilib 2005-07-27 09:34:19


Inglor, no one is gonna type FOSS: threads except of you and you know it = )
You're the only one who has TIME for that ,like your AS: threads :P


BBS Signature

Response to Foss: Apilib 2005-07-27 09:39:51


actually these are A LOT EASIER TO MAKE since you can just use code you've already written and document it, ninja-chicken and GG are making ones as we speak, and please don't be offtopic, try to submit useful API functions :)

Response to Foss: Apilib 2005-07-27 09:42:56


kk...Usefull!
Usefull API function:
lineStyle(1,0x000000,100);


BBS Signature