@Override
	public void render(GameContainer gc, Graphics g) {
		//our current y offset from the top
		int ypos = 0;
		Color reset = g.getColor();
		
		
		for (Message m : messages)
		{
					
			switch(m.getType())
			{
			case IMPORTANT:
				g.setColor(new HexColor(getImportantColor()));
				break;
			case ERROR:
				g.setColor(new HexColor(getErrorColor()));
				break;
			case SUCCESS:
				g.setColor(new HexColor(getSuccessColor()));
				break;
			case WARNING:
				g.setColor(new HexColor(getWarningColor()));
				break;
			}
			
			g.fill(new Rectangle(pos.getX(),pos.getY()+ypos,gc.getWidth()+2,height));
			if (getFont()!=null)
				g.setFont(getFont());
			g.setColor(new HexColor(getFontColor()));
			g.drawString(m.getMsg(), pos.getX(),pos.getY()+ypos+2);
		
			g.setColor(new Color(0,0,0,m.alphaValue));
			g.fill(new Rectangle(pos.getX(),pos.getY()+ypos,gc.getWidth()+2,height));
			
			if (m.alphaValue>255)
				messages.remove(m);
		
		
			ypos+=(height-1);
		}
		
		g.setColor(reset);
		
	}