![Quote](images/misc/quote_icon.png)
Originally Posted by
IzNoGoD
Most rects in macros need a 5th and a 6th argument iirc.
And you're right, it works. But I can't see the button with all these cases:
PHP Code:
rect _key 128 24 HORIZONTAL_ALIGN_DEFAULT VERTICAL_ALIGN_DEFAULT\
PHP Code:
rect _key 128 24 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
PHP Code:
rect 0 0 128 24 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
origin _key \
Something strange with coordinates now
Full code:
PHP Code:
#ifndef DRAW_WEAPON_ITEM
#define DRAW_WEAPON_ITEM(_key, _name) \
itemDef \
{ \
name "button_" ## #_name \
visible 1 \
rect 0 0 128 24 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN \
origin _key \
forecolor GLOBAL_UNFOCUSED_COLOR \
dvar "ui_weapon_" ## #_name \
textfont UI_FONT_NORMAL \
textscale .25 \
textstyle ITEM_TEXTSTYLE_SHADOWED \
textalignx 10 \
textaligny 20 \
}
#endif
#define DRAW_WEAPON(_key, _name) DRAW_WEAPON_ITEM(_key, _name)
DRAW_WEAPON(ORIGIN_CHOICEA, m1carbine_mp)