Advertisement
Guest User

image()

a guest
Aug 3rd, 2010
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. p.image = function image(img, x, y, w, h) {
  2.   if (img.width > 0) {
  3.     var wid = w || img.width;
  4.     var hgt = h || img.height;
  5.     if(p.use3DContext){
  6.       p.beginShape(p.QUADS);
  7.       p.textureMode(p.NORMAL)
  8.       p.texture(img);
  9.       p.vertex(x, y, 0, 0, 0);
  10.       p.vertex(x+wid, y, 0, 0, 1);
  11.       p.vertex(x+wid, y+hgt, 0, 1, 1);
  12.       p.vertex(x, y+hgt, 0, 1, 0);
  13.       p.endShape();
  14.     } else ...
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement