Menu-Color - Values


(Berzerkr) #1

Hi buds,

can anybody explain me the correct use of the color-codes for the menu?

backcolor       7 250 7 .9 
bordercolor     .5 .5 .5 .5

Wich value gives wich effect?
Exists a table or good manual for this?

Every help is welcome and will be creditet!

Thanks. :drink:


(MADDOG) #2

Try going to Miguel Nunes he made the color menus for ET and I think he knows or someone on his team knows how it works!


(Shanks) #3

AFAIK it uses RGBA with RGB using 0-255 and alpha using 0-1.


(Schaffer) #4

The backcolour is wrong. Where did that come from? The four numbers represent R G B A(alpha). Each is a value between 0 and 1, Maybe if you enter a value greater then 1 then it is automatically scalled down to 1. Not sure. Simple maths to convert is to grad each colour component value and divide by 255 (eg 200/255 = 0.784). You can put quite a few decimals if you like but more than 3 is pretty well pointless.

There is some semi decent documenttation of menu editing for Q3 Arena somewhere on the web. Made up of about 18 parts the doco is. A little out of date and dosn’t include any of the ET specific code but it is a good starting point. The menu system has some real quircky stuff to watch out for such as a limit on the number of items you can use per menu display and the maximum number of items defined. I was doing the Price of Peace menu system and found all sorts of bugs/limitations.


(Berzerkr) #5

Thanks guys, this helps a lot! :slight_smile:

The wrong values above are from figuring out how it works.


(Schaffer) #6

Your post reminded me that I should give you this link:
http://linux.ucla.edu/~phaethon/q3tamenu/q3tamenu.html

This is a good base if you are going to work with menus a bit. Helps understand a lot of the structure altough this is fairly old and some things have changed


(Berzerkr) #7

Thank you, the next step after the change of the colors is to set the main-menu to other x- y-coordinates.
Maybe it’s possible to change the styles, too. That I have to figure out.


(Schaffer) #8

Most of the “styles” are defined in the file menumacros.h. Basically what it does is it defines a heap of macros that accept parameters for building the UI components. Each macro contains definitions for the things like background style, background and foreground colours, borders and event related processing. You can easily modify the styles but hitting this file BUT if you are into wholesale changes then you might be better off recoding the menus from scratch. Lets you learn a lot. In a menudef you can group multiple entities together to give you a prefabricated control. You can also use calculatable macros to supply positioning relating information aling the lines of:


#define MENU_BUTTON_X(index) (index == 0) ? (BORDER_WIDTH) : ((2*BORDER_WIDTH)+LEFT_ITEM_WIDTH+(((BORDER_WIDTH+MENU_ITEM_WIDTH)*(index-1))))
#define MENU_BUTTON_WIDTH(index) (index == 0) ? (LEFT_ITEM_WIDTH) : (MENU_ITEM_WIDTH)