HUDRenderUtils

A Collection of methods for rendering 2D Objects in orthographic projection for the HUD or for a gui.

Coordinate space

The coordinate space used by the methods here sees the top left corner of your window as the origin 0,0. The x-axis is pointing towards the right of the screen. and the y-axis is pointing downwards.

Heavily based on the rendering for Funny Map by Harry282.

Author

Aton

Functions

Link copied to clipboard

Renders the player heads for funny map. Has the scaling directly integrated.

Link copied to clipboard
fun drawTexturedModalRect(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard

Disables the GL scissor test.

Link copied to clipboard
fun renderCenteredText(text: List<String>, x: Int, y: Int, color: Int)

Used for funny map text rendering. Has the text scaling directly integrated.

Link copied to clipboard
fun renderRect(x: Double, y: Double, w: Double, h: Double, color: Color)
Link copied to clipboard
fun renderRectBorder(x: Double, y: Double, w: Double, h: Double, thickness: Double, color: Color)
Link copied to clipboard
fun setUpScissor(x: Int, y: Int, width: Int, height: Int)

Sets up a GL scissor test for the specified region of the screen.

Link copied to clipboard
fun setUpScissorAbsolute(left: Int, top: Int, right: Int, bottom: Int)

Sets up a GL scissor test for the specified region of the screen.