Shooter Crosshair

Posted By: mschoenhals

Shooter Crosshair - 12/31/13 22:05

I've been working with AUM's Shooter code (issue 103) and the crosshair for the machine gun won't work.

It starts with a string:
STRING* crosshair_tga = "crosshair.tga";

then a panel:
PANEL* t_crosshair_pan;

Then in an action, when the player picks up the machinegun, this is used:
t_crosshair_pan = pan_create(NULL, 30);
t_crosshair_pan.bmap = bmap_create(crosshair_tga);

This is used at the start:
if (t_crosshair_pan)
{
t_crosshair_pan.pos_x = (screen_size.x - bmap_width(t_crosshair_pan.bmap)) / 2;
t_crosshair_pan.pos_y = (screen_size.y - bmap_height(t_crosshair_pan.bmap)) / 2;

Any ideas why this won't work?
Posted By: Kartoffel

Re: Shooter Crosshair - 12/31/13 23:50

did you set the SHOW flag?
Posted By: rayp

Re: Shooter Crosshair - 01/01/14 01:29

Btw please note that game_save / game_load wont work with dynamic created panels.

And i guess like Kartoffel u missed the SHOW flag. If not try
Code:
BMAP* crosshair_tga = "crosshair.tga"

instead of
Code:
STRING* ...



Cheers
Posted By: mschoenhals

Re: Shooter Crosshair - 01/01/14 16:21

Thanks!
That totally worked. It would be tough being a Nube without the help from folks like you! laugh
© 2024 lite-C Forums