-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from graycat27/textOutline#42
- Loading branch information
Showing
8 changed files
with
102 additions
and
26 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
project/src/main/java/com/github/graycat27/forge/flightHUDmod/consts/TextRenderType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.github.graycat27.forge.flightHUDmod.consts; | ||
|
||
public enum TextRenderType { | ||
NORMAL, | ||
SHADOW, | ||
OUTLINE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
project/src/main/java/com/github/graycat27/forge/flightHUDmod/util/TextRenderUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.github.graycat27.forge.flightHUDmod.util; | ||
|
||
import com.github.graycat27.forge.flightHUDmod.setting.GuiColor; | ||
import com.mojang.blaze3d.matrix.MatrixStack; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.FontRenderer; | ||
|
||
public class TextRenderUtil { | ||
|
||
private static Minecraft mc = Minecraft.getInstance(); | ||
private static FontRenderer fRnd = mc.fontRenderer; | ||
|
||
public static void drawString(String text, int posX, int posY, GuiColor color){ | ||
fRnd.drawString(new MatrixStack(), text, (float)posX, (float)posY, color.getInt()); | ||
} | ||
|
||
public static void drawStringWithShadow(String text, int posX, int posY, GuiColor color){ | ||
fRnd.drawStringWithShadow(new MatrixStack(), text, (float)posX, (float)posY, color.getInt()); | ||
} | ||
|
||
public static void drawStringWithOutLine(String text, int posX, int posY, GuiColor foreColor, GuiColor backColor){ | ||
drawString(text, posX-1, posY, backColor); | ||
drawString(text, posX+1, posY, backColor); | ||
drawString(text, posX, posY-1, backColor); | ||
drawString(text, posX, posY+1, backColor); | ||
drawString(text, posX, posY, foreColor); | ||
} | ||
} |