-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
good god - we gonna rock down to electric avenue
- Loading branch information
Showing
6 changed files
with
61 additions
and
13 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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,12 @@ | ||
package com.hbm.qmaw; | ||
|
||
public abstract class ManualElement { | ||
|
||
public int x; | ||
public int y; | ||
|
||
public abstract int getWidth(); | ||
public abstract int getHeight(); | ||
public abstract void render(boolean isMouseOver, int mouseX, int mouseY); | ||
public abstract void onClick(); | ||
} |
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,44 @@ | ||
package com.hbm.qmaw.components; | ||
|
||
import com.hbm.qmaw.ManualElement; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.FontRenderer; | ||
|
||
public class QComponentText extends ManualElement { | ||
|
||
protected String text; | ||
protected FontRenderer font; | ||
protected int color = 0xFFFFFF; | ||
|
||
public QComponentText(String text) { | ||
this(text, Minecraft.getMinecraft().fontRenderer); | ||
} | ||
|
||
public QComponentText(String text, FontRenderer font) { | ||
this.text = text; | ||
this.font = font; | ||
} | ||
|
||
public QComponentText setColor(int color) { | ||
this.color = color; | ||
return this; | ||
} | ||
|
||
@Override | ||
public int getWidth() { | ||
return font.getStringWidth(text); | ||
} | ||
|
||
@Override | ||
public int getHeight() { | ||
return font.FONT_HEIGHT; | ||
} | ||
|
||
@Override | ||
public void render(boolean isMouseOver, int mouseX, int mouseY) { | ||
font.drawString(text, x, y, color); | ||
} | ||
|
||
@Override public void onClick() { } | ||
} |