Difference between revisions of "0342"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
Line 9: Line 9:
 
}}
 
}}
  
This opcode sets the horizontal centering of the text, which is not centered by default. Without centering, the text uses the left side of the text to position itself. With centering, it uses the center of the text to position itself. If the [[0345|background of the text]] is on, centering the text causes the background to also center and stretch to a length of 640.0. The lead image on this page shows text displayed in Vice City at the x position of 100.0 and y positions starting at 10.0 and separated by 20.0 each. The first two lines are not centered, the next two lines are centered, the next line is not centered with background on, and the final line is centered with background on.
+
This opcode sets the horizontal centering of the text, which is not centered by default. Without centering, the text uses the left side of the text to position itself. With centering, it uses the center of the text to position itself. Centered text cannot use [[0343|wrap x]]; instead it uses [[0344|center size]], which defaults to a size of 640.0. The lead image on this page shows text displayed in Vice City at the x position of 100.0 and y positions starting at 10.0 and separated by 20.0 each. The first two lines are not centered, the next two lines are centered, the next line is not centered with background on, and the final line is centered with background on.
  
 
== Keywords ==
 
== Keywords ==
 
set, draw, intro, {{K|text}}, center, centre, centered
 
set, draw, intro, {{K|text}}, center, centre, centered

Latest revision as of 00:40, 23 November 2016

0342 in action

GTA III Vice City San Andreas SET_TEXT_CENTRE


Description
Sets the centering of the text
Syntax
0342: set_text_draw_centered [int]
Parameter
[int]
0 = not centered (default), 1 = centered

This opcode sets the horizontal centering of the text, which is not centered by default. Without centering, the text uses the left side of the text to position itself. With centering, it uses the center of the text to position itself. Centered text cannot use wrap x; instead it uses center size, which defaults to a size of 640.0. The lead image on this page shows text displayed in Vice City at the x position of 100.0 and y positions starting at 10.0 and separated by 20.0 each. The first two lines are not centered, the next two lines are centered, the next line is not centered with background on, and the final line is centered with background on.

Keywords

set, draw, intro, text, center, centre, centered