gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > building menus in gameplay

#167248 - moonlightcheese - Sat Mar 07, 2009 12:45 am

i'm working on a game for gba and i've got tiled backgrounds and sprites pretty well figured out but i'm a bit stumped on the way in which menus are built and driven.

i would think that maybe it would be switching to a different background, but i know how some games incorporate an overlay effect, dimming the playing field and showing the menu in the center of the screen. how is this achieved and can anyone provide some good places to get samples of game code?

EDIT: i'm looking for info on both pause menus and in-game menus, which i assume are just a series of maybe 8x8 sprites?

#167252 - sgeos - Sat Mar 07, 2009 2:06 am

You can dim the screen and drop some sprites that say "pause". For an overlay you may be using any combination of sprites and a BG depending on what you are doing.

In some games, the program will switch into a menu mode, so it can use everything. Are you familiar with model-view-controller? If so, think of a alternate menu screen as a different view and conroller for the same data.

There are a ton of ways to do this. The one you use will depend on the other things your program needs to do at the same time.

#167272 - Ruben - Sat Mar 07, 2009 4:41 pm

I'm not really sure what you mean by 'overlay effect' but it sounds as if you want something similar to what's present in Mario Kart Advance. Aka, you press enter, the screen dims and you've got a menu in the center.

I'm personally not sure of how that game uses its pause menu as I only played it on a friend's GBA, but I'd imagine that, since the fade isn't 100% fancy with tinting specific RGB values, you can just use the REG_COLEY/V to control a dimming to black/white (or to whatever color in palette entry 0).

If you can spare a background, I would suggest to have that background dedicated to text/windows, as using objects, you may run out of data (rare, but can happen if you have 100+ objects at once) and it's just downright more simple (to me, anyway >.>").

You can find example 'dimming' code in TONC under the graphics effects section (if I remember right).

But I'd still say that you should go with whatever you feel most comfortable with.

I personally wrote some color tinting code to 'tint/colorize' the screen to certain RGB values (if you've played a game where the screen goes red/blue/green/yellow/etc, you'll know what I mean), and it's available in LibAGB, but I don't think it's on the main page yet so.. if you want the code, leave a message.