Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MLabel{
- private String text = "";
- private int x, y, size;
- public int R, G, B;
- public MLabel(String text, int x, int y, int size, int r, int g, int b){
- this.text = text;
- this.x = x;
- this.y = y;
- this.size = size;
- this.R = r;
- this.G = g;
- this.B = b;
- }
- public MLabel(String text, int x, int y){
- this.text = text;
- this.x = x;
- this.y = y;
- this.size = 14;
- this.R = 255;
- this.G = 255;
- this.B = 255;
- }
- public MLabel(String text, int x, int y, int size){
- this.text = text;
- this.x = x;
- this.y = y;
- this.size = size;
- this.R = 255;
- this.G = 255;
- this.B = 255;
- }
- public void render(){
- pushMatrix();
- textSize(size);
- fill(R, G, B, 255);
- text(text.toString(), x, y);
- popMatrix();
- }
- public void setColor(int r, int g, int b){
- this.R = r;
- this.G = g;
- this.B = b;
- }
- public void setText(String text){
- this.text = text;
- }
- public String getText(){
- return this.text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement