diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cd1564d..3f84723 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,10 +2,13 @@ + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -593,8 +690,6 @@ - - @@ -744,16 +839,6 @@ - - - - - - - - - - @@ -782,16 +867,6 @@ - - - - - - - - - - @@ -881,18 +956,6 @@ - - - - - - - - - - - - @@ -901,29 +964,10 @@ - - - - - - - - - - - - - - - - - - - - - + + @@ -942,6 +986,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/globalgamejam/gui/GUI.java b/src/globalgamejam/gui/GUI.java new file mode 100644 index 0000000..c3dcd6b --- /dev/null +++ b/src/globalgamejam/gui/GUI.java @@ -0,0 +1,62 @@ +package globalgamejam.gui; + +import globalgamejam.input.Input; + +/** + * Created by trexr on 20/01/2017. + */ +public abstract class GUI { + private int mouseInGUI = 0;//0 = En dehors, 1 = entrer, 2 = deplacer + + protected int x, y; + protected int width,height; + + protected IActionGUI action; + + public GUI(int x,int y){ + this.x = x; + this.y = y; + this.width = 0; + this.height = 0; + } + + public void update(){ + float mouseX = Input.getMousePosition().x; + float mouseY = Input.getMousePosition().y; + if(mouseX >= this.x && mouseX <= this.x && mouseY >= this.y && mouseY <= this.y){ + for(int i = 0;i < Input.NBRE_BUTTON;i++){ + if(Input.isButton(i)){ + action.clicked(mouseX,mouseY,i,Input.getButtonState(i)); + } + } + if(mouseInGUI == 0){ + mouseInGUI = 1; + action.enter(mouseX,mouseY); + }else if(mouseInGUI == 1 && mouseInGUI == 2){ + mouseInGUI = 2; + action.move(mouseX,mouseY); + } + }else{ + if(mouseInGUI == 1 && mouseInGUI == 2){ + mouseInGUI = 0; + action.leave(mouseX,mouseY); + } + } + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } +} diff --git a/src/globalgamejam/gui/Label.java b/src/globalgamejam/gui/GUILabel.java similarity index 88% rename from src/globalgamejam/gui/Label.java rename to src/globalgamejam/gui/GUILabel.java index 2a03987..a7ae017 100644 --- a/src/globalgamejam/gui/Label.java +++ b/src/globalgamejam/gui/GUILabel.java @@ -1,356 +1,352 @@ -package globalgamejam.gui; -import static org.lwjgl.opengl.GL11.*; - -import java.awt.Color; -import java.awt.Font; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import java.nio.ByteBuffer; - -import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.GL12; - -/** - * usefull to print 2D text in openGL LWJGL application - * @author Jean-Baptiste Pommeret (Fiesta) - * @version 1.0 - */ -public class Label { - - private static final int BYTES_PER_PIXEL = 4;//3 for RGB, 4 for RGBA - - private Image label; - private float x, y; - private String text; - private Color color; - private int size; - private int witdh, height; - - private String font; - - /** - * Full constructor of a Label - * @param text (String) : the text to print - * @param xC (float) : the x coordonnate of the frame where start printing the Label (upper left corner) - * @param yC (float) : the y coordonnate of the frame where start printing the Label (upper left corner) - * @param color (java.awt.Color) : the Color you wish for the text - * @param font (String) : the font (i.e. "Arial" or "Times new roman") - * @param size (int) : the font size - */ - public Label(String text, float xC, float yC, Color color, String font, int size){ - this.text = text; - this.x = xC; - this.y = yC; - this.color = color; - this.size = size; - this.font = font; - - Font f_font = new Font(font, Font.PLAIN, size); - - // to get the width of the text - BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); - FontMetrics fm = img.getGraphics().getFontMetrics(f_font); - - this.witdh = fm.stringWidth(this.text); - this.height = fm.getHeight(); - - final BufferedImage image = new BufferedImage(this.witdh, this.height, BufferedImage.TYPE_INT_ARGB); -// makeTransparent(image); - - Graphics g = image.getGraphics(); - g.setFont(f_font); - g.setColor(this.color); - g.drawString(this.text, 0, size); - g.dispose(); - - int[] pixels = new int[image.getWidth() * image.getHeight()]; - image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); - - ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); //4 for RGBA, 3 for RGB - - for(int y = 0; y < image.getHeight(); y++){ - for(int x = 0; x < image.getWidth(); x++){ - int pixel = pixels[y * image.getWidth() + x]; - buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red component - buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component - buffer.put((byte) (pixel & 0xFF)); // Blue component - buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA - } - } - - buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS - - // You now have a ByteBuffer filled with the color data of each pixel. - // Now just create a texture ID and bind it. Then you can load it using - // whatever OpenGL method you want, for example: - - int textureID = glGenTextures(); //Generate texture ID - glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID - - //Setup wrap mode - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); - - //Setup texture scaling filtering - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - //Send texel data to OpenGL - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - glBindTexture(GL_TEXTURE_2D, 0); - - this.label = new Image(xC, yC, image.getWidth(), image.getHeight(), textureID); - } - - /** - * Default constructor of a Label. Call the full constructor -> Label("", 100, 100, Color.white, "Arial", 30) - */ - public Label(){ - this(""); - } - - /** - * Construct a Label from the text param and default statement. - * Call the full constructor -> Label(text, 100, 100, Color.white, "Arial", 30) - * @param text (String) : the text to print - */ - public Label(String text){ - this(text, 100, 100, Color.white, "Arial", 30); - } - - /** - * Return the actual Color of the Label - * @return color (java.awt.Color) : the Color of the Label - */ - public Color getColor() { - return color; - } - - /** - * Set the Color of the Label. Automaticaly update the Label to use the new Color - * @param color (java.awt.Color) : the new Color of the Label - */ - public void setColor(Color color) { - this.color = color; - - Font f_font = new Font(font, Font.PLAIN, size); - - // to get the width of the text - BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); - FontMetrics fm = img.getGraphics().getFontMetrics(f_font); - - this.witdh = fm.stringWidth(this.text); - this.height = fm.getHeight(); - - final BufferedImage image = new BufferedImage(this.witdh, this.height, BufferedImage.TYPE_INT_ARGB); -// makeTransparent(image); - - Graphics g = image.getGraphics(); - g.setFont(f_font); - g.setColor(this.color); - g.drawString(this.text, 0, size); - g.dispose(); - - int[] pixels = new int[image.getWidth() * image.getHeight()]; - image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); - - ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); //4 for RGBA, 3 for RGB - - for(int y = 0; y < image.getHeight(); y++){ - for(int x = 0; x < image.getWidth(); x++){ - int pixel = pixels[y * image.getWidth() + x]; - buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red component - buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component - buffer.put((byte) (pixel & 0xFF)); // Blue component - buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA - } - } - - buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS - - // You now have a ByteBuffer filled with the color data of each pixel. - // Now just create a texture ID and bind it. Then you can load it using - // whatever OpenGL method you want, for example: - - int textureID = glGenTextures(); //Generate texture ID - glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID - - //Setup wrap mode - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); - - //Setup texture scaling filtering - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - //Send texel data to OpenGL - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - glBindTexture(GL_TEXTURE_2D, 0); - - this.label = new Image(this.x, this.y, image.getWidth(), image.getHeight(), textureID); - } - - /** - * Return the text of the Label - * @return text (String) : the text of the Label - */ - public String getText() { - return text; - } - - /** - * Set the text of the Label. Automaticaly update the Label to use the new text - * @param text (String) : the new text to display - */ - public void setText(String text) { - this.text = text; - - Font f_font = new Font(font, Font.PLAIN, size); - - // to get the width of the text - BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); - FontMetrics fm = img.getGraphics().getFontMetrics(f_font); - - this.witdh = fm.stringWidth(this.text); - this.height = fm.getHeight(); - - final BufferedImage image = new BufferedImage(this.witdh, this.height, BufferedImage.TYPE_INT_ARGB); -// makeTransparent(image); - - Graphics g = image.getGraphics(); - g.setFont(f_font); - g.setColor(this.color); - g.drawString(this.text, 0, size); - g.dispose(); - - int[] pixels = new int[image.getWidth() * image.getHeight()]; - image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); - - ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); //4 for RGBA, 3 for RGB - - for(int y = 0; y < image.getHeight(); y++){ - for(int x = 0; x < image.getWidth(); x++){ - int pixel = pixels[y * image.getWidth() + x]; - buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red component - buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component - buffer.put((byte) (pixel & 0xFF)); // Blue component - buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA - } - } - - buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS - - // You now have a ByteBuffer filled with the color data of each pixel. - // Now just create a texture ID and bind it. Then you can load it using - // whatever OpenGL method you want, for example: - - int textureID = glGenTextures(); //Generate texture ID - glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID - - //Setup wrap mode - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); - - //Setup texture scaling filtering - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - //Send texel data to OpenGL - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); - - glBindTexture(GL_TEXTURE_2D, 0); - - this.label = new Image(this.x, this.y, image.getWidth(), image.getHeight(), textureID); - } - - /** - * Return the x coordonnate of the Label (upper left corner) - * @return x (float) : the x coordonnate of the Label - */ - public float getX() { - return x; - } - - /** - * Set the x coordonnate of the Label (upper left corner) - * @param x (float) : the new x coordonnate of the Label - */ - public void setX(float x) { - this.x = x; - label.setX(x); - } - - /** - * Return the y coordonnate of the Label (upper left corner) - * @return y (float) : the y coordonnate of the Label - */ - public float getY() { - return y; - } - - /** - * Set the y coordonnate of the Label (upper left corner) - * @param y (float) : the new y coordonnate of the Label - */ - public void setY(float y) { - this.y = y; - label.setY(y); - } - - /** - * Set both x and y coordonnate of the Label - * @param x (float) : the new x coordonnate of the Label - * @param y (float) : the new y coordonnate of the Label - */ - public void setPosition(float x, float y){ - this.setX(x); - this.setY(y); - } - - /** - * Return the Image of the Label - * @return label (Image) : the Image of the Label - */ - public Image getLabel(){ - return this.label; - } - - /** - * Return the witdh of the Label - * @return witdh (int) : the width - */ - public int getWitdh() { - return witdh; - } - - /** - * Return the height of the Label - * @return height (int) : the height - */ - public int getHeight() { - return height; - } - - /** - * make the image transparent - * @param obj_img (BufferedImage) : the BufferedImage to make transparent - */ -/* private void makeTransparent(BufferedImage obj_img){ - byte alpha = (byte)255; - alpha %= 0xff; - for (int cx=0;cx> 16) & 0xFF)); // Red component + buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component + buffer.put((byte) (pixel & 0xFF)); // Blue component + buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA + } + } + + buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS + + // You now have a ByteBuffer filled with the color data of each pixel. + // Now just create a texture ID and bind it. Then you can load it using + // whatever OpenGL method you want, for example: + + int textureID = glGenTextures(); //Generate texture ID + glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID + + //Setup wrap mode + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + + //Setup texture scaling filtering + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + //Send texel data to OpenGL + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + glBindTexture(GL_TEXTURE_2D, 0); + + this.label = new Image(xC, yC, image.getWidth(), image.getHeight(), textureID); + } + + /** + * Default constructor of a Label. Call the full constructor -> Label("", 100, 100, Color.white, "Arial", 30) + */ + public GUILabel(){ + this(""); + } + + /** + * Construct a Label from the text param and default statement. + * Call the full constructor -> Label(text, 100, 100, Color.white, "Arial", 30) + * @param text (String) : the text to print + */ + public GUILabel(String text){ + this(text, 100, 100, Color.white, "Arial", 30); + } + + /** + * Return the actual Color of the Label + * @return color (java.awt.Color) : the Color of the Label + */ + public Color getColor() { + return color; + } + + /** + * Set the Color of the Label. Automaticaly update the Label to use the new Color + * @param color (java.awt.Color) : the new Color of the Label + */ + public void setColor(Color color) { + this.color = color; + + Font f_font = new Font(font, Font.PLAIN, size); + + // to get the width of the text + BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + FontMetrics fm = img.getGraphics().getFontMetrics(f_font); + + super.width = fm.stringWidth(this.text); + super.height = fm.getHeight(); + + final BufferedImage image = new BufferedImage(super.width, super.height, BufferedImage.TYPE_INT_ARGB); +// makeTransparent(image); + + Graphics g = image.getGraphics(); + g.setFont(f_font); + g.setColor(this.color); + g.drawString(this.text, 0, size); + g.dispose(); + + int[] pixels = new int[image.getWidth() * image.getHeight()]; + image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); + + ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); //4 for RGBA, 3 for RGB + + for(int y = 0; y < image.getHeight(); y++){ + for(int x = 0; x < image.getWidth(); x++){ + int pixel = pixels[y * image.getWidth() + x]; + buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red component + buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component + buffer.put((byte) (pixel & 0xFF)); // Blue component + buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA + } + } + + buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS + + // You now have a ByteBuffer filled with the color data of each pixel. + // Now just create a texture ID and bind it. Then you can load it using + // whatever OpenGL method you want, for example: + + int textureID = glGenTextures(); //Generate texture ID + glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID + + //Setup wrap mode + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + + //Setup texture scaling filtering + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + //Send texel data to OpenGL + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + glBindTexture(GL_TEXTURE_2D, 0); + + this.label = new Image(this.x, this.y, image.getWidth(), image.getHeight(), textureID); + } + + /** + * Return the text of the Label + * @return text (String) : the text of the Label + */ + public String getText() { + return text; + } + + /** + * Set the text of the Label. Automaticaly update the Label to use the new text + * @param text (String) : the new text to display + */ + public void setText(String text) { + this.text = text; + + Font f_font = new Font(font, Font.PLAIN, size); + + // to get the width of the text + BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + FontMetrics fm = img.getGraphics().getFontMetrics(f_font); + + super.width = fm.stringWidth(this.text); + super.height = fm.getHeight(); + + final BufferedImage image = new BufferedImage(super.width, super.height, BufferedImage.TYPE_INT_ARGB); +// makeTransparent(image); + + Graphics g = image.getGraphics(); + g.setFont(f_font); + g.setColor(this.color); + g.drawString(this.text, 0, size); + g.dispose(); + + int[] pixels = new int[image.getWidth() * image.getHeight()]; + image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); + + ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); //4 for RGBA, 3 for RGB + + for(int y = 0; y < image.getHeight(); y++){ + for(int x = 0; x < image.getWidth(); x++){ + int pixel = pixels[y * image.getWidth() + x]; + buffer.put((byte) ((pixel >> 16) & 0xFF)); // Red component + buffer.put((byte) ((pixel >> 8) & 0xFF)); // Green component + buffer.put((byte) (pixel & 0xFF)); // Blue component + buffer.put((byte) ((pixel >> 24) & 0xFF)); // Alpha component. Only for RGBA + } + } + + buffer.flip(); //FOR THE LOVE OF GOD DO NOT FORGET THIS + + // You now have a ByteBuffer filled with the color data of each pixel. + // Now just create a texture ID and bind it. Then you can load it using + // whatever OpenGL method you want, for example: + + int textureID = glGenTextures(); //Generate texture ID + glBindTexture(GL_TEXTURE_2D, textureID); //Bind texture ID + + //Setup wrap mode + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); + + //Setup texture scaling filtering + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + //Send texel data to OpenGL + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + glBindTexture(GL_TEXTURE_2D, 0); + + this.label = new Image(this.x, this.y, image.getWidth(), image.getHeight(), textureID); + } + + /** + * Return the x coordonnate of the Label (upper left corner) + * @return x (float) : the x coordonnate of the Label + */ + public int getX() { + return x; + } + + /** + * Set the x coordonnate of the Label (upper left corner) + * @param x (float) : the new x coordonnate of the Label + */ + public void setX(int x) { + super.setX(x); + label.setX(x); + } + + /** + * Return the y coordonnate of the Label (upper left corner) + * @return y (float) : the y coordonnate of the Label + */ + public int getY() { + return y; + } + + /** + * Set the y coordonnate of the Label (upper left corner) + * @param y (float) : the new y coordonnate of the Label + */ + public void setY(int y) { + super.setY(y); + label.setY(y); + } + + /** + * Set both x and y coordonnate of the Label + * @param x (float) : the new x coordonnate of the Label + * @param y (float) : the new y coordonnate of the Label + */ + public void setPosition(int x, int y){ + this.setX(x); + this.setY(y); + } + + /** + * Return the Image of the Label + * @return label (Image) : the Image of the Label + */ + public Image getLabel(){ + return this.label; + } + + /** + * Return the witdh of the Label + * @return witdh (int) : the width + */ + public int getWitdh() { + return super.width; + } + + /** + * Return the height of the Label + * @return height (int) : the height + */ + public int getHeight() { + return super.height; + } + + /** + * make the image transparent + * @param obj_img (BufferedImage) : the BufferedImage to make transparent + */ +/* private void makeTransparent(BufferedImage obj_img){ + byte alpha = (byte)255; + alpha %= 0xff; + for (int cx=0;cx