Difference between revisions of "03F0"

From GTAMods Wiki
Jump to navigation Jump to search
(page rewrite)
(included proper usage)
Line 2: Line 2:
 
| games      = {{Icon|t}}
 
| games      = {{Icon|t}}
 
| command    = USE_TEXT_COMMANDS
 
| command    = USE_TEXT_COMMANDS
| description = Sets text display
+
| description = Sets [[Text#Display text|text]] display
 
| syntax1    = 03F0: enable_text_draw [''int'']
 
| syntax1    = 03F0: enable_text_draw [''int'']
 
| p1t        = [''int'']
 
| p1t        = [''int'']
| p1d        = 0 = remove text, 1 = enable text
+
| p1d        = 0 = don't use text commands, {{hint|1|or any value other than 0}} = use text commands
 
}}
 
}}
  
This opcode allows the removal of all text displayed using opcodes such as [[033E]].
+
This opcode allows the display and removal of all text displayed using opcodes such as [[033E]]. Just before displaying text of that type, switch on this opcode and then perform whatever task you want with the text. After you are done displaying text, you switch off this opcode.
  
== Example ==
+
== Examples ==
The following example using Sanny Builder demonstrates the usage of this opcode along with a display text opcode in a loop. Press the CAMERA key to increase the value of the counter on the screen.
+
The following example using Sanny Builder demonstrates the lazy usage of this opcode along with a display text opcode in a loop. Press the CAMERA key to end the counter on the screen.
 
<syntaxhighlight lang="scm">
 
<syntaxhighlight lang="scm">
 
const
 
const
NUMBER = 0@
+
COUNT_NUMBER = 0@
 
end
 
end
  
Line 22: Line 22:
 
         00E1:  player 0 pressed_button 13  // camera key
 
         00E1:  player 0 pressed_button 13  // camera key
 
     then
 
     then
         NUMBER += 1
+
         break
 
     end
 
     end
     045A: text_draw_1number 10.0 10.0 'NUMBER' NUMBER
+
    COUNT_NUMBER += 1
 +
     045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
 
     03F0: enable_text_draw 0
 
     03F0: enable_text_draw 0
 +
end
 +
</syntaxhighlight>
 +
 +
The following example demonstrates the "proper" usage in the same code using Rockstar's technique.
 +
<syntaxhighlight lang="scm">
 +
const
 +
COUNT_NUMBER = 0@
 +
end
 +
 +
03F0: enable_text_draw 1
 +
while true
 +
    wait 10
 +
    if
 +
        00E1:  player 0 pressed_button 13  // camera key
 +
    then
 +
        03F0: enable_text_draw 0
 +
        break
 +
    end
 +
    COUNT_NUMBER += 1
 +
    045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
 
end
 
end
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 17:19, 26 February 2016

GTA III Vice City San Andreas USE_TEXT_COMMANDS


Description
Sets text display
Syntax
03F0: enable_text_draw [int]
Parameter
[int]
0 = don't use text commands, 1 = use text commands

This opcode allows the display and removal of all text displayed using opcodes such as 033E. Just before displaying text of that type, switch on this opcode and then perform whatever task you want with the text. After you are done displaying text, you switch off this opcode.

Examples

The following example using Sanny Builder demonstrates the lazy usage of this opcode along with a display text opcode in a loop. Press the CAMERA key to end the counter on the screen.

const
COUNT_NUMBER = 0@
end

while true
    wait 10
    if
        00E1:   player 0 pressed_button 13  // camera key
    then
        break
    end
    COUNT_NUMBER += 1
    045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
    03F0: enable_text_draw 0
end

The following example demonstrates the "proper" usage in the same code using Rockstar's technique.

const
COUNT_NUMBER = 0@
end

03F0: enable_text_draw 1
while true
    wait 10
    if
        00E1:   player 0 pressed_button 13  // camera key
    then
        03F0: enable_text_draw 0
        break
    end
    COUNT_NUMBER += 1
    045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
end

Keywords

use, enable, text, draw, commands