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 / Make bitmap transparent on plane

Author
Message
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 11th Jan 2009 00:54
On the enclosed Im trying to make a nametag. But I cant make the bitmap transparent on the black area. Its maybe very easy but I dont know how

Im making the tag like this:



Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.

Attachments

Login to view attachments
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 13th Jan 2009 14:21
No one??

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
haliop
User Banned
Posted: 13th Jan 2009 20:33
i have an idea that might work , not sure of it but you can try

set player NAME as dbText and save that on a bitmap
them GetImage(1,...
and db SaveImage(as.. "PlayerName.bmp"...

dbLoadImage("Playername.bmp"
then use that BMp as Sprite , now i don't know if thats good for your idea , but heres the exaple



so what you'll get is this a Windows BMP file named NameTage.bmp
with a NAme "Nadav" in the middle of it.
let me explain so it won't see too much..

first we create a name varible
second we create a new Bitmap so we can draw on it, in our case we Write Text in it.
third implenting the Text in that bitmap , now if you look at the X and Y varibles , there is a little calc in it which makes the Text in the Center of the Bitmap, play with it a bit.
four , we Save the bitmap into an IMAGE located in PC memory with an ID of 1 (or whatever number..).
five, we Save the Bitmap into a File named "NameTag.bmp"
six, Deleting the Bitmap we worked on , we don't need it on memory anymore..
and finally
SetCurrentBitmap (0) Returning All Proccess on Screen.

so you get a File with a name tag
then , you Load the image and use it as a Sprite

if this is good for you , so i think its a nice way.
also you can change your Text Fonts and everything..

i hope helped you.
nadav

Attachments

Login to view attachments
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 14th Jan 2009 00:59
Im doing all that except for saving the file. But I want to make the black area transperant...

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 14th Jan 2009 02:32
I don't think you need to do that. Would this work?



if you put that in your main loop, it might work.
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 14th Jan 2009 09:41 Edited at: 14th Jan 2009 10:44
Hi Niels,

Here is how I did a similar sort of thing when I created a Sun that was painted on a 1x1 mesh *.X object.



The Sun.png texture was produced with a sun picture painted on a transparent background so that only the sun would be visible.
From memory you do require dbSetObjectTransparency().

Hope that gives you something to work from.
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 14th Jan 2009 20:18
@sydbod: dbSetObjectTransparency was the one I was missing... perfect.. thanks.

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.

Login to post a reply

Server time is: 2024-09-30 15:30:48
Your offset time is: 2024-09-30 15:30:48