1. Introduction to Text_Draw
2. Get a working Text_Draw thread
3. Parameter Explanation
4. Drawing textures
5. Differences in games
Introduction to Text_Draw
Hello 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 Blood
This 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 thread
In GTA III/VC, create a thread containing/insert in main this:
|03F0: text_draw_toggle 1 |
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:
Explanation of the 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.
|;; 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.
|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!
- Initial Version
Edited by grovespaz, 25 October 2007 - 06:17 PM.