如何为 FiveM LUA 在屏幕上绘制图像(比如某种标志)

How to draw an image on screen (Like a logo of some sort) for FiveM LUA

只是一个简单的问题,我相信答案并不那么简单; LUA 是否可以在屏幕上绘制图像? 如是;哪个 Native 用于此? 如果不;使用另一种语言的简单方法是什么?

提前致谢!

Lua 本身没有这样做的功能,但 FiveM 有。 (这样做的结果是其他使用Lua的游戏将有自己的绘制功能,而不会有这个)。在这种情况下,您需要 the DrawSprite function:

-- 0xE7FFAE5EBF23D890 0x1FEC16B0
-- DRAW_SPRITE
DrawSprite(
  textureDict --[[ string ]], 
  textureName --[[ string ]], 
  screenX --[[ number ]], 
  screenY --[[ number ]], 
  width --[[ number ]], 
  height --[[ number ]], 
  heading --[[ number ]], 
  red --[[ integer ]], 
  green --[[ integer ]], 
  blue --[[ integer ]], 
  alpha --[[ integer ]]
)

Draws a 2D sprite on the screen. Parameters:

  • textureDict - Name of texture dictionary to load texture from (e.g. "CommonMenu", "MPWeaponsCommon", etc.)
  • textureName - Name of texture to load from texture dictionary (e.g. "last_team_standing_icon", "tennis_icon", etc.)
  • screenX/Y - Screen offset (0.5 = center)
  • scaleX/Y - Texture scaling. Negative values can be used to flip the texture on that axis. (0.5 = half)
  • heading - Texture rotation in degrees (default = 0.0) positive is clockwise, measured in degrees
  • red,green,blue - Sprite color (default = 255/255/255)
  • alpha - opacity level
NativeDB Added Parameter 12: BOOL p11