
image()
By: a guest on Aug 3rd, 2010 | syntax:
JavaScript | size: 0.41 KB | hits: 149 | expires: Never
p.image = function image(img, x, y, w, h) {
if (img.width > 0) {
var wid = w || img.width;
var hgt = h || img.height;
if(p.use3DContext){
p.beginShape(p.QUADS);
p.textureMode(p.NORMAL)
p.texture(img);
p.vertex(x, y, 0, 0, 0);
p.vertex(x+wid, y, 0, 0, 1);
p.vertex(x+wid, y+hgt, 0, 1, 1);
p.vertex(x, y+hgt, 0, 1, 0);
p.endShape();
} else ...
}