What I want to do is simple. I want to be able to draw a message box to the screen that wraps the height of the box to the size of the text within it.
I am using android's canvas objects to do this, but I do not know how this can be done with this library.
I am trying to reproduce this:
I want to be able to change the text that is within the banner and have it wrap the height. Can someone tell me how this is done?
EDIT
This is what I have currently. There is a lot of math and it barely works for one resolution let alone all of them.
int x = (int) SCREEN_WIDTH / 2, y = (int) ((SCREEN_HEIGHT / 1.3f) + messageBox.getPaint().getTextSize() + 10);
String[] message = messageBox.getMessage().split("\n");
for (String line: message)
{
System.out.println(message.length);
canvas.drawText(line, x, y, messageBox.getPaint());
y += -messageBox.getPaint().ascent() + messageBox.getPaint().descent();
}
and
private void resizeBox() {
if(message == null)
return;
String[] msg = message.split("\n");
this.bottom += (this.getPaint().getTextSize() + 10) * msg.length;
}