gokuta Posted July 12, 2017 Share Posted July 12, 2017 (edited) 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 July 12, 2017 by gokuta Link to comment Share on other sites More sharing options...
DK22Pac Posted July 12, 2017 Share Posted July 12, 2017 (edited) 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 July 12, 2017 by DK22Pac kosticn101 1 Link to comment Share on other sites More sharing options...