- Displays an onscreen counter supporting text
- 03C4: set_status_text_to [global var] [int] '[string]'
This opcode displays a counter, either shown in numbers or as a bar. The counter need only be called once and will automatically associate and update itself with the value stored in the global variable. Counters only support global variables storing integer values. For type 1 bar, the length of the empty bar represents values between 0 and 100. Values outside the range will either underfill or overfill the empty bar. Additional counters cannot be displayed until the existing counter is removed. Opcode 0151 removes the counter.
Both of these counters are from Vice City, both with a value of 100.
The following example, using Sanny Builder, will create a full bar counter. Pressing the CAMERA key will deplete the bar. A number is displayed at the bottom of the screen to view the exact value of the bar. Once depleted, the counter disappears.
$100 = 100 03C4: set_status_text_to $100 1 'DUMMY' while true wait 10 if 00E1: key_pressed 0 13 then $100 -= 1 01E5: text_1number_highpriority 'NUMBER' $100 10 ms 1 if 0 >= $100 then 0151: remove_status_text $100 break end end end
- 0150, counter that does not support text
- 04F7, counter that supports text in addition to line position
counter, status, text, bar