Difference between revisions of "03F0"

From GTAMods Wiki
Jump to navigation Jump to search
(included proper usage)
(highlight)
 
Line 2: Line 2:
 
| games      = {{Icon|t}}
 
| games      = {{Icon|t}}
 
| command    = USE_TEXT_COMMANDS
 
| command    = USE_TEXT_COMMANDS
| description = Sets [[Text#Display text|text]] display
+
| description = Use [[Text#Intro text|text]] commands
 
| syntax1    = 03F0: enable_text_draw [''int'']
 
| syntax1    = 03F0: enable_text_draw [''int'']
 
| p1t        = [''int'']
 
| p1t        = [''int'']
Line 8: Line 8:
 
}}
 
}}
  
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.
+
This opcode allows the display and removal of all intro 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 ==
 
== 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.
+
The following example using Sanny Builder demonstrates a standard usage of this opcode along with a display text opcode in a loop. Press [[00E1|button 13]] (CAMERA key) to end the counter on the screen.
<syntaxhighlight lang="scm">
+
{{Pre|class=sb-code|1=
const
+
<span class="k">const</span>
COUNT_NUMBER = 0@
+
COUNT_NUMBER = <span class="nv">0@</span>
end
+
<span class="k">end</span>
  
while true
+
03F0: enable_text_draw <span class="m">1</span>
     wait 10
+
<span class="k">while</span> <span class="k">true</span>
     if
+
     <span class="k">wait</span> <span class="m">10</span>
         00E1:  player 0 pressed_button 13  // camera key
+
     <span class="k">if</span>
     then
+
         [[00E1]]:  player <span class="m">0</span> pressed_button <span class="m">13</span> <span class="c1">// camera key</span>
 +
     <span class="k">then</span>
 +
        03F0: enable_text_draw <span class="m">0</span>
 
         break
 
         break
     end
+
     <span class="k">end</span>
     COUNT_NUMBER += 1
+
     COUNT_NUMBER += <span class="m">1</span>
     045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
+
     045A: text_draw_1number <span class="m">10.0</span> <span class="m">10.0</span> <span class="s1">'NUMBER'</span> COUNT_NUMBER
    03F0: enable_text_draw 0
+
<span class="k">end</span>
end
+
}}
</syntaxhighlight>
 
  
The following example demonstrates the "proper" usage in the same code using Rockstar's technique.
+
The following is an alternative non-standard way to display text.
<syntaxhighlight lang="scm">
+
{{Pre|class=sb-code|1=
const
+
<span class="k">const</span>
COUNT_NUMBER = 0@
+
COUNT_NUMBER = <span class="nv">0@</span>
end
+
<span class="k">end</span>
  
03F0: enable_text_draw 1
+
<span class="k">while</span> <span class="k">true</span>
while true
+
     <span class="k">wait</span> <span class="m">10</span>
     wait 10
+
     <span class="k">if</span>
     if
+
         [[00E1]]:  player <span class="m">0</span> pressed_button <span class="m">13</span> <span class="c1">// camera key</span>
         00E1:  player 0 pressed_button 13  // camera key
+
     <span class="k">then</span>
     then
 
        03F0: enable_text_draw 0
 
 
         break
 
         break
     end
+
     <span class="k">end</span>
     COUNT_NUMBER += 1
+
     COUNT_NUMBER += <span class="m">1</span>
     045A: text_draw_1number 10.0 10.0 'NUMBER' COUNT_NUMBER
+
     045A: text_draw_1number <span class="m">10.0</span> <span class="m">10.0</span> <span class="s1">'NUMBER'</span> COUNT_NUMBER
end
+
    03F0: enable_text_draw <span class="m">0</span>
</syntaxhighlight>
+
<span class="k">end</span>
 +
}}
  
 
== Keywords ==
 
== Keywords ==

Latest revision as of 02:44, 21 December 2016

GTA III Vice City San Andreas USE_TEXT_COMMANDS


Description
Use text commands
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 intro 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 a standard usage of this opcode along with a display text opcode in a loop. Press button 13 (CAMERA key) to end the counter on the screen.

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

The following is an alternative non-standard way to display text.

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

Keywords

use, enable, text, draw, commands