Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Forum Support

    3. Suggestions

gxt display FLOAT


gokuta
 Share

Recommended Posts

Ok, I found this opcode:

07FC: display_text_with_float 10.0 140.0 gxt 'FLOAT' value [email protected] 4

In my case 'FLOAT' is "~1~.~1~"

 

Works as expected with positive numbers, but not with negative ones. When, let's say, -1000.125 is passed, -1000.-125 is printed out. How can I fix this bull****. Any ideas? Thanks

Edited by gokuta
Link to comment
Share on other sites

I guess this opcode was not intended to work with negative numbers.

 

You can use any alternative way to display a float number, for example, 045B.

 

 

{$CLEO}0ADF: add_text_label 'FLOAT1' text "~1~.~1~"0ADF: add_text_label 'FLOAT2' text "~1~.0~1~"0ADF: add_text_label 'FLOAT3' text "~1~.00~1~"0ADF: add_text_label 'FLOAT4' text "~1~.000~1~"while true    0001: wait 0    [email protected] = -1000.125    0092: [email protected] = float_to_int [email protected]    0093: [email protected] = int_to_float [email protected]    0087: [email protected] = [email protected]    0063: [email protected] -= [email protected]    if        [email protected] < 0.0    then        [email protected] *= -1.0    end    if         [email protected] < 0.001    then        [email protected] = 'FLOAT4'    else        if            [email protected] < 0.01        then            [email protected] = 'FLOAT3'        else            if                [email protected] < 0.1            then                [email protected] = 'FLOAT2'            else                [email protected] = 'FLOAT1'            end        end    end    [email protected] *= 10000.0    0092: [email protected] = float_to_int [email protected]    0092: [email protected] = float_to_int [email protected]      033F: set_text_scale 1.3 3.36    0340: set_text_colour 255 255 255 255    0348: set_text_proportional 1    0349: set_text_font 1    0343: set_text_size 640.0    0341: set_text_justify 1    081C: set_text_edge 1 rgba 0 0 0 255    045B: display_text_with_2_numbers 10.0 140.0 gxt [email protected] numbers [email protected] [email protected]    03F0: use_text_commands 0end
Edited by DK22Pac
Link to comment
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
 Share

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

×
×
  • Create New...

Important Information

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