all of you know those aimers when u see them in fps games... the gun aimers. for people who don't know, i am talking about the cross thing from which you aim... hopefully u guys know what i mean now.
i know how to set it up, just set an image OF THE AIMER in the middle of the screen. the thing is how to make the background transparent
like in the case when u set up a billboard, there is function u use to set the backgorund of the billboard transparent, by setting the backgorund of the billboard to black which enables it to be transparent,
is there anything similar like to set the background color to black or any color of the aimer to make it transparent
THXS FOR ALL THE HELP
SETTING A GUN AIMER
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
SETTING A GUN AIMER
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
Hi,
just use a HUD (head up display) texture and do the following:
And in your game loop just draw it (you have to define, where your cross is located in the texture):
Regards - Xaron
just use a HUD (head up display) texture and do the following:
Code: Select all
// load the hud texture
hudTexture = driver->getTexture( "media/graphics/hud/hud.png" );
// color black will be transparent
driver->makeColorKeyTexture( hudTexture, video::SColor( 0, 0, 0, 0 ) );
Code: Select all
driver->draw2DImage( hudTexture, core::position2d<s32>( xCenter - 16, yCenter - 16 ), core::rect<s32>( 168, 99, 168 + 33, 99 + 33 ), 0, video::SColor( 255, 255, 255, 255 ), true );
If you have a look at the examples and look into the Collision one, under the Billboard section you will find the line
That makes the Billboard transparent and also with color of the aimer, and removing the black at the same time
I hope this has helped you
Ry
Code: Select all
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
I hope this has helped you
Ry
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
Xaron i don't know how to DECLARED hud...
IF YOU DON'T KNOW WHAT IT MEAN BY DECLARING... DECLARING IS SIMILAR TO WHEN YOU MAKE A DEVICE SAYING Irrlichtdevice * device=0;
can you please tell me how to declare a hud though like
/*whatever*/ * hud = 0;
IF YOU DON'T KNOW WHAT IT MEAN BY DECLARING... DECLARING IS SIMILAR TO WHEN YOU MAKE A DEVICE SAYING Irrlichtdevice * device=0;
can you please tell me how to declare a hud though like
/*whatever*/ * hud = 0;
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
try this. (credit to the other posters for most of the code, im just putting it together mostly)
Code: Select all
ITexture* hudTexture = driver->getTexture("replace this with your crosshair (aimer)'s filename" );
// color black will be transparent
driver->makeColorKeyTexture( hudTexture, video::SColor( 0, 0, 0, 0 ) );
device->getGUIEnvironment()->addImage(hudTexture, position2d<s32>((device->getVideoDriver()->getScreenSize().Width - hudTexture->getOriginalSize().Width) / 2, (device->getVideoDriver()->getScreenSize().Height - hudTexture->getOriginalSize().Height) / 2));
New RF2 website at: http://realityfactory2.sourceforge.net/
-
- Posts: 19
- Joined: Thu Feb 09, 2006 1:45 am
AndyCR .............. THANKS A LOT
AND A LOT OF THANKS TO THE PEOPLE WHO CAME OUT WITH THIS IDEA
BUT
CREDIT GOES TO AndyCR CAUSE HE PUT THE CODE TOGETHER ... AND IT WORKS
AND A LOT OF THANKS TO THE PEOPLE WHO CAME OUT WITH THIS IDEA
BUT
CREDIT GOES TO AndyCR CAUSE HE PUT THE CODE TOGETHER ... AND IT WORKS
TO ALL THE AMATEURS OUT THERE LIKE ME......
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME
AIM HIGH AND YOU MAKE SOMETHING PRETTY DECENT TO SHOW THE WORLD
CURRENTLY WORKING ON MY COMPANY WITH ME CREW MEMBERS. MY COMPANY IS CALLED
BIG DREAMS
AND WE ARE MAKE VERSION 0.1 FPS GAME