- Draws the sprite
- 038D: draw_texture [int1] position [flt1] [flt2] size [flt3] [flt4] RGBA [int2] [int3] [int4] [int5]
- Memory slot
- X-position from the left side of the screen
- Y-position from the top side of the screen
- Width in pixels
- Height in pixels
This opcode draws the sprite loaded through opcode 038F. The games draw sprites in a similar manner to intro text so it requires opcode 03F0 to draw properly. Unlike intro text, the positions and dimensions are absolute and does not scale with resolution. Drawing an invalid sprite will result in a colored rectangle. This opcode was never called in the original scripts of GTA III or Vice City.
The following example for Vice City using Sanny Builder moves a sprite named RKCHAT from HUD.txd across the screen and draws a counter displaying the current horizontal position of the sprite. Pressing button 13 (CAMERA key) removes the sprite and counter.
const X_POSITION = [email protected] COUNT_NUMBER = [email protected] end 0390: load_txd_dictionary 'HUD' 038F: load_texture 'RKCHAT' as 1 X_POSITION = 100.0 COUNT_NUMBER = 100 03F0: enable_text_draw 1 while true wait 0 if 00E1: player 0 pressed_button 13 // camera key then 03F0: enable_text_draw 0 break end 038D: draw_texture 1 position X_POSITION 100.0 size 64.0 64.0 RGBA 255 255 255 255 X_POSITION += 1.0 045A: text_draw_1number 100.0 100.0 'NUMBER' COUNT_NUMBER COUNT_NUMBER += 1 end 0391: release_textures
draw, texture, sprite