-
-
Notifications
You must be signed in to change notification settings - Fork 35
RenderCommon SubClass
wagyourtail edited this page Sep 20, 2020
·
4 revisions
class text {
constructor(text, x, y, color, shadow, scale, rotation); // text is a String. x,y,color are Ints. shadow is a boolean.
setPos(x, y);
setText(String text);
setScale(double); //1.2.6
setRotation(float); //1.2.6+
getWidth() // text length.
}
class rect {
constructor(x1, y1, x2, y2, color); // x1,y1,x2,y2,color are Ints.
constructor(x1, y1, x2, y2, color, alpha, rotation); // 1.1.8+ x1,y1,x2,y2,color,alpha are Ints.
setPos(x, y);
setColor(color);
setColor(color, alpha); //1.1.8+
setAlpha(alpha); //1.1.8+
setRotation(float); //1.2.6+
}
class item {
constructor(x, y, item, overlay, scale, rotation); // x,y are Ints. item is a string or an ItemStackHelper. overlay is a boolean and is only in 1.2.0+
setPos(x, y);
setOverlay(bool); // 1.2.0+
setOverlayText(str); // 1.2.0+ (it's probably a good idea to use `.copy()` when passing an ItemStackHelper)
setScale(double); //1.2.6
setRotation(float); //1.2.6+
getItem(); //1.2.0+ returns the ItemStackHelper
setItem(item, count); // if item is a ItemStackHelper, don't include count.
}
class image {
constructor(x, y, width, height, imageid, imageX, imageY, regionWidth, regionHeight, textureWidth, textureHeight, rotation);
setPos(x, y, width, height);
setImage(imageid, imageX, imageY, regionWidth, regionHeight, textureWidth, textureHeight);
setRotation(float); //1.2.6+
getImage(); // returns string imageid
}