public void draw(SpriteBatchWrapper sprites) { if (!this.listening) return; this.drawGlassPane(sprites); Vector2 center = sprites.getCenterOfScreen(); int boxWidth = 500; int boxHeight = 150; int boxX = (int)(center.X - (boxWidth / 2)); int boxY = (int)(center.Y - (boxHeight / 2)); this.drawBox(sprites, boxWidth, boxHeight, boxX, boxY); if (null != this.message) { int msgHeight = sprites.getHeightOfText(this.message, 1.0f, MESSAGE_FONT_NAME); int msgWidth = sprites.getWidthOfText(this.message, 1.0f, MESSAGE_FONT_NAME); int msgY = boxY + (boxHeight / 4) - (msgHeight / 2); int msgX = (int) center.X - (msgWidth / 2); sprites.drawTextAt(this.message, msgX, msgY, 1.0f, Color.LightGray, MESSAGE_FONT_NAME); } this.drawTextBox(sprites, center, boxWidth); }
/*public virtual void drawInLine(SpriteBatchWrapper sprites, int line) { sprites.drawTextCentered(this.title, line, this.selected ? Color.Orange : Color.GhostWhite); }*/ public virtual void drawFromCenter(SpriteBatchWrapper sprites, int x, int y) { int width = sprites.getWidthOfText(this.title, 1.0f, FONTNAME); int textureWidth = this.texture.bounds.Width; if (textureWidth < width + 20) { textureWidth = width + 20; } sprites.drawTextureAt( this.texture.texture, textureWidth, this.texture.bounds.Height, x - textureWidth/2, y); int textY = y + (int)(this.texture.bounds.Height * .3); sprites.drawTextAt( this.title, x - width / 2, textY, 1.0f, this.selected ? Color.Orange : Color.GhostWhite, FONTNAME); }