-
-
Notifications
You must be signed in to change notification settings - Fork 39
Draw2D Class
The Draw2D Class, methods are as follows:
this is OverlayHud in 1.0.5
Example: new Draw2D()
Initialize, to call this it is easiest to refer to Hud.
put a js function here for initializing elements. Example:
hud.onInit = (hud_obj) => {
let rgb = 0xFFFFFF;
hud_obj.addText("hello, world!", 0, 0, rgb, true);
}
Example: overlay.getWidth()
returns the internal width of the window.
Example: overlay.getHeight()
returns the internal height of the window.
Example: overlay.getTexts()
returns an ArrayList
of RenderCommon$text elements.
Example: overlay.getRects()
returns an ArrayList
of RenderCommon$rect elements.
Example: overlay.getItems()
returns an ArrayList
of RenderCommon$item elements.
Example: overlay.getImages()
returns an ArrayList
of RenderCommon$image elements.
Example: overlay.addText("Text", x, y, rgbHex, shadow, scale, rotation)
-
scale
/rotation
optionals were added in 1.2.6+
returns the RenderCommon$text object.
Example: overlay.removeText(t)
removes a RenderCommon$text element from the screen.
Example: overlay.addRect(x1, y1, x2, y2, argbHex, alpha, rotation)
- alpha was added in version 1.1.8+
- alpha is optional and can just be in the
argbHex
field.
- alpha is optional and can just be in the
- rotation was added in version 1.2.6+
- alpha is required to use rotation.
returns the RenderCommon$rect object.
Example: overlay.removeRect(r)
removes a RenderCommon$rect element from the screen.
Example: overlay.addImage(x, y, width, height, id, imageX, imageY, regionWidth, regionHeight, textureWidth, textureHeight, rotation)
-
rotation
was added in 1.2.6+
returns the RenderCommon$image object.
Example: overlay.removeImage(image)
remove a RenderCommon$image element from the screen.
Example: overlay.addItem(x, y, item, showOverlay, scale, rotation)
-
showOverlay
added in 1.2.0+ -
scale
/rotation
optionals were added in 1.2.6+
returns the RenderCommon$item object.
Example: overlay.addItem(x, y, itemid, showOverlay, scale, rotation)
-
showOverlay
added in 1.2.0+ -
scale
/rotation
optionals were added in 1.2.6+
returns the RenderCommon$item object.
Example: overlay.removeItem(i)
removes an RenderCommon$item element from the screen.