Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

grovespaz

The Big Text_Draw Topic

Recommended Posts

grovespaz

 

Text_Draw Explanation

 

1. 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_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 wink.gif

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                    :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:

user posted image

(clickable)

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!

 

 

Post history:

  • Initial Version
Edited by grovespaz

Share this post


Link to post
Share on other sites
grovespaz

Parameter Explanation

In 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

 

033E: text_draw  X  Y "GXT TEXT"

The Über text draw code, draws the text on the screen.

 

Works on:

  • GTA III
  • GTA VC
  • GTA SA
Set Letter Width And Height

 

033F: set_text_draw_letter_width_height  float (width) float (height)

Sets the width and height of the letters

Reported to work on:

  • GTA III
Set Text Color

 

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:

  • GTA III
  • GTA VC
Center Text

 

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:

user posted image

 

If toggled off:

user posted image

 

Parameters used in screenshot not related to parameter:

 

0344: (unknown)_text_draw_width  580.00340: set_text_draw_color  190  190  190 255033F: set_text_draw_letter_width_height  .75  1.00348: set_text_draw_proportional  1 

 

 

Reported to work on

  • GTA III
Draw Text In Box

 

0345: set_text_draw_in_box  Toggle(1=on/0=off)

Draw the text in a box

GTAIII:

If used with style 0 (Default):

user posted image

 

If used with style 1:

user posted image

 

Parameters used:

 

0346: set_text_draw_background_color  0  0  0 1000345: set_text_draw_in_box  1

 

 

Reported to work on:

  • GTA III
Set Box Background Color

 

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:

  • GTA III
Proportional Font

 

0348: set_text_draw_proportional  1

 

Use Proportional Font (1=fixed width, 0=proportional)

GTAIII:

Toggle on:

user posted image

 

Toggle off:

user posted image

 

Parameters used in screenshot not related to parameter:

 

0344: (unknown)_text_draw_width  580.00342: set_text_draw_centered  1 0340: set_text_draw_color  190  190  190 255033F: set_text_draw_letter_width_height  .75  1.0

 

Reported to work on:

  • GTA III
Set Text Style

 

0349: text_draw_style =  0

Sets the font in which to Text_Draw.

GTAIII:

Style 0 (Default):

user posted image

 

Style 1:

user posted image

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:

 

0344: (unknown)_text_draw_width  580.00342: set_text_draw_centered  1 0340: set_text_draw_color  190  190  190 255033F: set_text_draw_letter_width_height  .75  1.00348: set_text_draw_proportional  1 0346: set_text_draw_background_color  0  0  0 1000345: set_text_draw_in_box  1

 

Reported to work on:

  • GTA III
Unknown/Not Tested Yet opcodes:

 

UNKNOWN: Width

 

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

 

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:

  • GTA VC
Not Tested Yet: Text with two numbers

 

045B: text_draw_1number  320.0  400.0 "TEXT" Int1 Int2

 

Supposed to draw text including 2 numbers

 

Reported to work on:

  • GTA VC
Not Tested Yet: Align Right

 

03e4: set_text_draw_align_right 1

 

Supposed to allign the text right, instead of left.

 

Not Tested Yet: Draw Textures

 

Dunno

 

If anyone is willing to investigate this before i do, be my guest wink.gifrah.gif

Reported to work on:

  • GTA SA
Post history:
  • Initial Version
Edited by grovespaz

Share this post


Link to post
Share on other sites
grovespaz

Drawing Textures

I haven't looked into drawing textures yet. Expect me to do so soon..

 

Differences in games

This is the info i got off Demarest wink.gif

 

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:

  • Initial Version
Edited by grovespaz

Share this post


Link to post
Share on other sites
grovespaz

(Post reserved for future updates...)

Share this post


Link to post
Share on other sites
Bigun

Hey, good job icon14.gif , but isn't creating some tutorial specifically for a few opcodes a bit too much? Should've really just replied in the Opcodes thread. Otherwise, this belongs to the Tutorials forum (what's with posting threads like this here? tounge.gif ).

Share this post


Link to post
Share on other sites
grovespaz

Well, the first post is indeed a small tutorial about how to get a working Text_Draw.

 

The posts after that are meant more as a collection of text_draw opcodes. Anyone can contribute. That kinda stuff.. tounge.gif

Since this is new to most people, and since this could be such a great influence on mods (Displaying your own graphics/huds/whatever through mission script is something wink.gif ), and since this is still very WIP.

I thought this would get more attention it deserves, seeing how advanced coders rarely look in the tutorial forum IMHO.

Edited by grovespaz

Share this post


Link to post
Share on other sites
Bigun

 

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. smile.gif (hope Dem sees and assimlates that sentence).

Share this post


Link to post
Share on other sites
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. smile.gif (hope Dem sees and assimlates that sentence).

smile.gif 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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.