Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sniper Scope

Author
Message
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 17th May 2009 11:44
At the moment i have my scope appearing on screen but im not sure how to make the white centre transparent at the moment heres my code:


Any help would be appreciated !

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
go2none
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location: London
Posted: 17th May 2009 13:21 Edited at: 17th May 2009 13:40
You may try using dbSprite instead if pasting an image and setting that sprite's alpha. Image 970 is your scope, right?

Before main loop and after you loaded an image add:



In you RMB code try:



The above method will make whole sprite transparent. If you want part of the image to be transparent, use your drawing program to add alpha channel to your image. Save it as *.png and hide/show without fiddling with dbSetSpriteAlpha.
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 17th May 2009 13:41
Ok right so if i want to make the middle white i have to add "alpha channel" how do i do that in say gimp ??

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
go2none
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location: London
Posted: 17th May 2009 14:35 Edited at: 17th May 2009 14:36
1. Open your image in Gimp
2. Right click it and select:
3. Layer >> Transparency >> Add Alpha Channel
4. Select and cut parts of the image you want to be transparent
5. Save as *.png with default settings.

For more detailed tutorial you should visit gimp forums or just try Google for alpha channel and gimp.
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 17th May 2009 19:42
1) Ok ive done it thanks, how would i be able to do it so that if i right click it appears and i can let go of right click and it stay up until i right click again

2) How can i do so if the scope is up and i left click it lets me shoot whilst the scope stays up

Thanks

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"

Login to post a reply

Server time is: 2024-10-01 01:23:11
Your offset time is: 2024-10-01 01:23:11