Jump to content

scrpt with dxDrawImage


Recommended Posts

This is correct?

local sWidth, sHeight = guiGetScreenSize() 
local Width, Height = 1366, 768  --write the width and height here 
local X = sWidth - Width 
local Y = 0 
  
function HUD() 
    local weaponType = getPedWeapon(localPlayer) 
    dxDrawImage(300, 300, 128, 128, "Weapons/"..tostring(weaponType).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)  
end 
  
function HandleTheRendering() 
    addEventHandler("onClientRender", getRootElement(), HUD) 
end 
addEventHandler("onClientResourceStart", resourceRoot, HandleTheRendering) 

Link to comment

almost. 2 mistakes.

local Width, Height = 500, 150  -- dont write here your resolution. Write here the width and height of the image you want to draw with dxDrawImage 

function HUD() 
    local weaponType = getPedWeapon(localPlayer) 
    dxDrawImage(X, Y, Width, Height, "Weapons/"..tostring(weaponType).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) --you have to use the X, Y, Width, Height variables here to work 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...