Well, this menu creation was an annoying adventure. The font ->
bitmap program I previously had, it made a bitmap which wasn't quite
compatible with the code. The code converted each character to its ascii
value, then used that to retrieve the correct letter from the image. I
won't go into detail, but it does work. So, I had to look for another
program to make a bitmap which I can use.
CBFG
(http://www.codehead.co.uk/cbfg/), it's free and works. I chose to use
both the bitmap export and its custom file export (which includes
specifics of the character's size). Then it took awhile to get the code
sorted out till it worked (took about 10 hours to get it working
straight).
Then I had to adjust the color of the menu
items to correspond to fading in and fading out. Little easier, but
still took an hour or 2. For a usable transparency, I had to reduce the
ceiling value from 255 to 16, everything above 16 looks the same (yes,
very weird).
After the text was properly displayed, it
had to be properly moved and faded in/out when the user scrolled
up/down. This.....it had a lot of testing. It wasn't until I stopped
trial/error testing and drew up a mock action picture that the code
worked. The transparency has a few glitches, they skip a bit when near
their entrance/ exit, but its good enough for now.
Oh,
and I even branched the text drawing code to draw color changing text
(as seen in the title in the attached image). There wasn't much new code
needed to do the action and the code worked on the first test (which is
always a good sign).
At this point, the menu is stage 1
complete (display menu items and change them using the spool). Stage 2,
have the menu items actually do something.
Due
to time constraints, all the items will do the same thing, which is to
start the game. And.....the game is due this Tuesday. Well, something at
least playable besides a menu.
To accomplish this game task, I need to learn about
loading XMLs (which will contain data about each block), then make a
level generator. Lucky me, the physics and display of the reel/ spools
has already been completed while working on the menu (short of the camera view).
= Todo =
- Add more blocks
- Add action data to the block
- Code up a level generator (which will also tell each block which panel it will be using)
- Figure out how to start the game (I'm swinging more towards using a new GLSurfaceView rather than a new Activity)
p.s. Nearly forgot to say this. I turned down (off) the ambient light, reduced the worldly spot light, and played with the block's per-vertex additional colors....and now the blocks have the appearance of being "self-illuminated". It's not as beautiful as I was wanting originally and there isn't any light produced by the block, but its enough for now to show what is selected.
= future todo =
- scrolling left/right will fade in new menu items and out-fade the old
- add lighting to the blocks for a more elegant look
- add sounds effects/ music
- get that damn camera working. LINEAR IS TOO PLAIN!!!
After a bit of thinking of how to move the camera around with the reel....I think I may end up moving to another graphics engine. Rajawali not only has more features, but the code is open source too. I might end up switching after Tuesday, I got too much on my plate to start switching now.
ReplyDeletehttp://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/