Quote:
Originally Posted by TheStan
I'd have to tell you on AIM because I'm not allowed to put it out there like that.
|
I've made a function that flips images, but I'd rather have on built in.. It's also pretty inefficient and stuff.
Rescripted it in about 10 minutes... woohoo for highly inefficient & laggy workaround scripts!
PHP Code:
// NPC made by Tig
//#CLIENTSIDE
function onCreated() {
this.image = "door.png";
flipHorizontal();
}
function flipHorizontal() {
this.i = null;
for (temp.w = 0; temp.w < getimgwidth(this.image); temp.w ++) {
for (temp.h = 0; temp.h < getimgheight(this.image); temp.h ++) {
showimg(200 + this.i, this.image, x - (w * 1/16), y + (h * 1/16));
changeimgvis(200 + this.i, 3);
changeimgpart(200 + this.i, w, h, 1, 1);
this.i ++;
}
}
hide();
}
function flipVerticle() {
this.i = null;
for (temp.w = 0; temp.w < getimgwidth(this.image); temp.w ++) {
for (temp.h = 0; temp.h < getimgheight(this.image); temp.h ++) {
showimg(200 + this.i, this.image, x + (w * 1/16), y - (h * 1/16));
changeimgvis(200 + this.i, 3);
changeimgpart(200 + this.i, w, h, 1, 1);
this.i ++;
}
}
hide();
}
function flipBoth() {
this.i = null;
for (temp.w = 0; temp.w < getimgwidth(this.image); temp.w ++) {
for (temp.h = 0; temp.h < getimgheight(this.image); temp.h ++) {
showimg(200 + this.i, this.image, x - (w * 1/16), y - (h * 1/16));
changeimgvis(200 + this.i, 3);
changeimgpart(200 + this.i, w, h, 1, 1);
this.i ++;
}
}
hide();
}