Skip to content

MIDP Low-Level UI Pains

Over the last couple of week I’ve been doing some work with the MIDP low level UI API. I’ve used the API before, but not for anything that complex. This time however I am building a set of fairly complex rich UI screens, so it’s been a good opportunity to really get to grips with the API. It’s been so long that I’d forgotten how sparse it all is.

One thing that has been really annoying me over the last few days is the lack of a way to rotate the orientation of text. I want some of the labels in my UI to be written down the side of the screen (top to bottom). You can anchor text pretty easily, and alter it’s horizontal alignment, but there is no way rotate it so it reads top to bottom rather than left to right.

One suggested way to get around this is to draw the text to an off-screen in, memory image then rotate this image before drawing it on the display. But, of course, there is no way to rotate an image either!

…Now I remember why I don’t like using low level graphics.

For now I’m just not bothering with the rotated labels (it’s only a prototype at the moment), but ideally I’d like to find a solution. One possibility I’d thought of is to simply write my own way of rotating images - maybe an operation on the actual bytes in the image, or swapping pixels.

Post a Comment

Your email is never published nor shared. Required fields are marked *