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.

Code Snippets / "Text to Image" that alot of ppl is looking for

Author
Message
Jack LOL
18
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 22nd Aug 2006 12:09 Edited at: 28th Aug 2006 01:33
i made the function that is fully working(as much as i know)
that i was looked some time ago.
anyway it needs some other code then only the function:
Function is fully working!!

the function:


parameters:
1.str is the string u want to show.
2.x is the x coord where u want the text.
3.y is the y coord where u want the text.
4.size is the size of the text.
5.font is the font of the text.
6.color is the text color(fill with rgb(..,..,..)).
7.priority is the sprite priority of the text.
8.imgcolkey is the color rgb value for transperncy(the same that used with the "set image colorkey" command, just with rgb(..,..,..).
9.centerflag is if u want to offset the text and to put on the middle of the x y text(set to 1) or from the left upper side of the text(set to 0).
10.imgnum is the image number the text will be on.
11.sprnum is the sprite number the text will be on.

here how it works:



Thanks for Xenocythe who made understand how to make it to work.

lol?! xD
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 22nd Aug 2006 17:38
All I see in DBPro is a bunch of black lines moving up the camera. Would make a cool 'getting hit' effect to the screen

Applyby has Flies in his Eyes.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 23rd Aug 2006 01:12 Edited at: 23rd Aug 2006 01:12
Lines
Lines
Lines
And Lines.

And btw it seems kinda complex

Jack LOL
18
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 23rd Aug 2006 11:56 Edited at: 23rd Aug 2006 11:57
No1 Reads the edit??!!
i think its a current bitmap prob

lol?! xD
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 23rd Aug 2006 18:57
Well, this is actually how you would go text to image:




Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Aug 2006 21:07
Yeah but it's better in a function

Jack LOL
18
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 24th Aug 2006 02:17
Thanks again Xenocythe ive found the problem with your code

lol?! xD
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 24th Aug 2006 04:30 Edited at: 24th Aug 2006 04:30
Quote: "Yeah but it's better in a function "


Okay.




But a very interesting funtion you've made here Jack.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 24th Aug 2006 05:48
Sixty,

A line in your code says:
if bitmap exist(1) then delete bitmap 1

That is very unneeded. As you can see at the bottom of my code in your function, it already deletes bitmap 1


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 26th Aug 2006 17:21
Yeah but he need's to delete it if it already exists.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 26th Aug 2006 20:36
Who doesn't delete bitmap one after making a custom texture?


Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 28th Aug 2006 05:55
Now just combine this with the 3dsprite function that cucumber (I think?) wrote and you've got nice onscreen text.

Harvard's Law, as Applied to Computers:
Under the most rigorously controlled conditions of pressure, temperature, volume, humidity and other variables, the computer will do as it d*mn well pleases.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Aug 2006 17:45
Quote: "Who doesn't delete bitmap one after making a custom texture? "

A noob

Jack LOL
18
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 29th Aug 2006 11:13
Sixty Squares:
is that your own smiley

lol?! xD
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 29th Aug 2006 22:07
No, you can just click 'more' to the bottom right of the smileys


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Aug 2006 22:23
here it is: : P without the space.

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 1st Sep 2006 22:30
: P looks more like
: p should be


gotnoname
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: Sweden
Posted: 20th Sep 2006 19:43
I hate being a noob in spots like this... I donĀ“t even understand where to put the script.
Like the Code snippet.. Do i just like copy that in to my level file?

Homer Simpson

Login to post a reply

Server time is: 2024-11-23 03:19:27
Your offset time is: 2024-11-23 03:19:27