|
 |
|
|
|
|
|
GTA Modification Forums
The Big Text_Draw Topic Including Parameters & Descriptions
 |
|
 |
| |
grovespaz  |
Posted: Thursday, Nov 23 2006, 13:10
|
Group: Morons

Group: Members
Joined: Feb 22, 2004


|
Text_Draw Explanation1. Introduction to Text_Draw 2. Get a working Text_Draw thread 3. Parameter Explanation 4. Drawing textures 5. Differences in games 6. Thankword Introduction to Text_DrawHello all, I am grovespaz, and this post will be all about Text_Draw. Now you might ask, 'What is Text_Draw?'. Text_Draw is a powerfull set of opcodes, that can be used to display text (and is SA, pictures(!)) everywhere on the screen. In any size, color, and sometimes even shape. The best example i can give you is Demarest's Thirst For BloodThis post is meant to be a guide to Text_Draw. But it is also meant to be created by everyone who wants to. That means, that if you find out a whole new parameter, or have a tiny update, just post, and this post will be edited  This is not a guide to code 'newbies', you must be an intermeddiate coder of you want Text_Draw to work, and an advanced one if you want to create something usefull.. Now then, Text_Draw is a very strange set of opcodes. My best guess on why it behaves like it behaves, is that is is being forced almost directly into the frame buffer. PLEASE NOTE: Do not expect a fully worked out post! this list will be updated as we experiment.Get a working Text_Draw threadIn GTA III/VC, create a thread containing/insert in main this: | CODE | 03F0: text_draw_toggle 1 :LabelTextDraw 0001: wait 0 ms ;; Insert parameters here. 033E: text_draw 320.0 400.0 "M_FAIL" 0002: jump ££LabelTextDraw |
If you run it, you will probably see this:  (clickable) Explanation of the code: | CODE | | 03F0: text_draw_toggle 1 |
One of the most important opcodes while using Text_Draw. If you want to use Text_Draw, you will have to toggle it on first. This only needs to be done once, then you can use it troughout the whole mission script. | CODE | | ;; Insert parameters here. |
This is the place where you will be inserting the parameters which will affect the Text_Draw. Scroll down to see 'em. | CODE | | 033E: text_draw 320.0 400.0 "M_FAIL" |
THE most important opcode. This is the opcode which actually displays the text on screen. Further explanation: Once the Text_Draw_Toggle is toggled on, the mission script goes into a loop. This is one of the most important things to remember while using Text_Draw, The Text_Draw needs to be called every frame. This means that you will have to set every parameter again every frame. Remember this!The Wait 0 ms ensures that the game will keep running, and that the Text_Draw opcode will be strobed every frame. Great! Now that you have a working Text_Draw thread, lets move on to different parameters! Post history: This post has been edited by grovespaz on Thursday, Oct 25 2007, 18:17
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
grovespaz  |
Posted: Thursday, Nov 23 2006, 13:10
|
Group: Morons

Group: Members
Joined: Feb 22, 2004


|
Parameter ExplanationIn this part I will be collecting the different parameters, allong with screenshots of their effects. Please note that this list is very WIP at the moment. Not all information may be accurate at the moment.I have also included a little list to store compatibility information. If the list says 'Works on', it means that the opcodes have been tested on ALL GTA's, and work on the GTA's in the list. If the list says 'Reported to work on', it means it has been tested on that GTA only yet. Contribute by testing yourself. Text Draw| CODE | | 033E: text_draw X Y "GXT TEXT" |
The Über text draw code, draws the text on the screen. Works on: Set Letter Width And Height| CODE | | 033F: set_text_draw_letter_width_height float (width) float (height) |
Sets the width and height of the letters Reported to work on: Set Text Color| CODE | | 0340: set_text_draw_color int (Red) int (Green) int (Blue) int (Opacity) |
Sets the color in which to draw, last value controls the opacity/transperancy of the text (255=fully visible, 0= invisible). Reported to work on: Center Text| CODE | | 0342: set_text_draw_centered Toggle(1=on/0=off) |
If set to zero, text will start from the position specified later, if set to one, it will be the centerpoint of the text GTAIII:If toggled on:  If toggled off:  Parameters used in screenshot not related to parameter: | CODE | 0344: (unknown)_text_draw_width 580.0 0340: set_text_draw_color 190 190 190 255 033F: set_text_draw_letter_width_height .75 1.0 0348: set_text_draw_proportional 1 |
Reported to work on Draw Text In Box| CODE | | 0345: set_text_draw_in_box Toggle(1=on/0=off) |
Draw the text in a box GTAIII:If used with style 0 (Default):  If used with style 1:  Parameters used: | CODE | 0346: set_text_draw_background_color 0 0 0 100 0345: set_text_draw_in_box 1 |
Reported to work on: Set Box Background Color| CODE | | 0346: set_text_draw_background_color int (Red) int (Green) int (Blue) int (Opacity) |
Set the background color of the box surrounding the letters, used in conjunction with 0345. Last value sets opacity. Reported to work on: Proportional Font| CODE | | 0348: set_text_draw_proportional 1 |
Use Proportional Font (1=fixed width, 0=proportional) GTAIII:Toggle on:  Toggle off:  Parameters used in screenshot not related to parameter: | CODE | 0344: (unknown)_text_draw_width 580.0 0342: set_text_draw_centered 1 0340: set_text_draw_color 190 190 190 255 033F: set_text_draw_letter_width_height .75 1.0 |
Reported to work on: Set Text Style| CODE | | 0349: text_draw_style = 0 |
Sets the font in which to Text_Draw. GTAIII:Style 0 (Default):  Style 1:  Note that this style seems to ignore any color, proportional and some other parameters.. I've included the box around the text to show you it changes too. Style 2 seems to have no letters, and any higher crashes the game.. Parameters used in screenshots not related to this opcode: | CODE | 0344: (unknown)_text_draw_width 580.0 0342: set_text_draw_centered 1 0340: set_text_draw_color 190 190 190 255 033F: set_text_draw_letter_width_height .75 1.0 0348: set_text_draw_proportional 1 0346: set_text_draw_background_color 0 0 0 100 0345: set_text_draw_in_box 1 |
Reported to work on: Unknown/Not Tested Yet opcodes:UNKNOWN: Width| CODE | | 0344: (unknown)_text_draw_width 580.0 |
It is unknown what this opcode does. It is assumed that it controls something about the width. Update!: I think this is connected to the width of the box around the text.. Stay Tuned. Not Tested Yet: Text with one number| CODE | | 045A: text_draw_1number 320.0 400.0 "TEXT" Int |
Supposed to draw text including a number (IE. Mission Passed! $1000) Reported to work on: Not Tested Yet: Text with two numbers| CODE | | 045B: text_draw_1number 320.0 400.0 "TEXT" Int1 Int2 |
Supposed to draw text including 2 numbers Reported to work on: Not Tested Yet: Align Right| CODE | | 03e4: set_text_draw_align_right 1 |
Supposed to allign the text right, instead of left. Not Tested Yet: Draw TexturesIf anyone is willing to investigate this before i do, be my guest Reported to work on: Post history: This post has been edited by grovespaz on Thursday, Nov 23 2006, 18:15
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
grovespaz  |
Posted: Thursday, Nov 23 2006, 13:10
|
Group: Morons

Group: Members
Joined: Feb 22, 2004


|
Drawing TexturesI haven't looked into drawing textures yet. Expect me to do so soon.. Differences in gamesThis is the info i got off Demarest  | QUOTE (Demarest) | The 3 games behave a bit differently. And to be honest, I don't fully remember them. IIRC, the following are true, but you shouldn't experiment to make certain.
In GTA3 and VC, the size of your "canvas" is actual screen resolution of the game. In SA, it's a constant 640 x 480. However, when text drawing textures, all 3 games consider the canvas to be something like 640 x 448.
When text drawing textures, GTA3's version of the command specifies upper left corner coord and XY span. Whereas VC and SA specify center coord and XY span. | Thankword, etcetera..Well, thats it, if you have any questions, just post! List of thanks: - I'd like to thank Demarest, for getting me into Text_Draw, and guiding me through the first hard steps. Our conversations have been the seed of this post.
Post history: This post has been edited by grovespaz on Thursday, Nov 23 2006, 15:26
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Bigun  |
Posted: Thursday, Nov 23 2006, 17:41
|
wandering about

Group: Members
Joined: Jul 10, 2004


|
| QUOTE (grovespaz) | | I thought this would get more attention it deserves, seeing how advanced coders rarely look in the tutorial forum IMHO. |
Unfortunately, I agree. Though it doesn't really change where it should be, if every tutorial just goes in it's respective section, there shouldn't be a Tutorials forum. Same thing for Recruits & Requests. I think maybe people should post in the tutorials forum, then post a new thread linking to it in the respective section (and ask for discussion only in the original topic, possibly requesting the linking one to be locked). I'm not a mod though, and maybe the mods don't think the same as me though, so this can stay here.  (hope Dem sees and assimlates that sentence).
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
grovespaz  |
Posted: Thursday, Nov 23 2006, 18:08
|
Group: Morons

Group: Members
Joined: Feb 22, 2004


|
| QUOTE (Bigun @ Nov 23 2006, 17:41) | | QUOTE (grovespaz) | | I thought this would get more attention it deserves, seeing how advanced coders rarely look in the tutorial forum IMHO. |
Unfortunately, I agree. Though it doesn't really change where it should be, if every tutorial just goes in it's respective section, there shouldn't be a Tutorials forum. Same thing for Recruits & Requests. I think maybe people should post in the tutorials forum, then post a new thread linking to it in the respective section (and ask for discussion only in the original topic, possibly requesting the linking one to be locked). I'm not a mod though, and maybe the mods don't think the same as me though, so this can stay here. (hope Dem sees and assimlates that sentence). |  Ontop of that, this isn't supposed to be a tutorial. Alright, so the first post contains a mini-tutorial, the Paramater section is much more important. In the weekends, i'll try to figure out the SA texture loading.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|