|
1
|
|
|
package de.kleiner3.lasertag.common.util; |
|
2
|
|
|
|
|
3
|
|
|
import net.minecraft.client.gui.DrawableHelper; |
|
4
|
|
|
import net.minecraft.client.util.math.MatrixStack; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Helper class extending the base drawing functionality of Minecraft's DrawableHelper |
|
8
|
|
|
* |
|
9
|
|
|
* @author Étienne Muser |
|
10
|
|
|
*/ |
|
11
|
|
|
public abstract class AdvancedDrawableHelper extends DrawableHelper { |
|
12
|
|
|
/** |
|
13
|
|
|
* Draw a non-filled rectangle on the matrix stack |
|
14
|
|
|
* @param matrices The matrix stack |
|
15
|
|
|
* @param startX The x-coordinate where to start the rectangle |
|
16
|
|
|
* @param startY The y-coordinate where to start the rectangle |
|
17
|
|
|
* @param endX The x-coordinate where to end the rectangle |
|
18
|
|
|
* @param endY The y-coordinate where to end the rectangle |
|
19
|
|
|
* @param color The color of the rectangle |
|
20
|
|
|
*/ |
|
21
|
|
|
protected void drawRectangle(MatrixStack matrices, int startX, int startY, int endX, int endY, int color) { |
|
22
|
|
|
// Draw the left line |
|
23
|
|
|
drawVerticalLine(matrices, startX, startY - 1, endY, color); |
|
24
|
|
|
|
|
25
|
|
|
// Draw the top line |
|
26
|
|
|
drawHorizontalLine(matrices, startX + 1, endX, startY, color); |
|
27
|
|
|
|
|
28
|
|
|
// Draw the right line |
|
29
|
|
|
drawVerticalLine(matrices, endX, startY, endY + 1, color); |
|
30
|
|
|
|
|
31
|
|
|
// Draw the bottom line |
|
32
|
|
|
drawHorizontalLine(matrices, startX, endX - 1, endY, color); |
|
33
|
|
|
} |
|
34
|
|
|
} |
|
35
|
|
|
|