Jump to content

HELP SYSTEM LIFE


NETCHK

Recommended Posts

1 hour ago, NETCHK said:

??

he sent you a topic for you to take a look at and for that you look at this : 

Quote

Yea, that's a bit better, but no, it's not dxDrawImage what you're looking for. You will need to use dxDrawImageSection

And Exemple :
 

addEventHandler('onClientRender', root, function()
local health = getElementHealth(localPlayer)
local myIconHeight = 120 --pixels
local vSize = myIconHeight / 100 * health
	dxDrawImageSection(400, 200, 64, 64, 0, 0, myIconHeight, vSize, 'egyedi/hp_full.png')
	dxDrawImage(400, 300, 128, 128, 'egyedi/hp_full.png')
end)

 

Edited by raynner
Link to comment
23 hours ago, raynner said:

he sent you a topic for you to take a look at and for that you look at this : 

And Exemple :
 


addEventHandler('onClientRender', root, function()
local health = getElementHealth(localPlayer)
local myIconHeight = 120 --pixels
local vSize = myIconHeight / 100 * health
	dxDrawImageSection(400, 200, 64, 64, 0, 0, myIconHeight, vSize, 'egyedi/hp_full.png')
	dxDrawImage(400, 300, 128, 128, 'egyedi/hp_full.png')
end)

 

Is it the same as the heart system I did in the picture?:(

Link to comment

I did, but there is a problem the image is too big

local hudS = {}
		--hudS.bgX, hudS.bgY = ConvertAbsoluteToRelative( 300, 20 ) -- Y position of background
		hudS.bgW, hudS.bgH = 0, 0
		hudS.fX, hudS.fY = 339, 800  -- Y position of fill
		hudS.fW, hudS.fH = 100, 190 
		
		--dxDrawImage(hudS.bgX, hudS.bgY, hudS.bgW, hudS.bgH, myTexture["144"])
		local currHeight = hudS.fH / 100 * getElementHealth(localPlayer) 
		dxDrawImageSection(hudS.fX, hudS.fY, hudS.fW-, currHeight, hudS.bgW, hudS.bgH, hudS.fW, currHeight, "heart.png")

 

Link to comment

I think it should work!

local hudS = {}
--hudS.bgX, hudS.bgY = ConvertAbsoluteToRelative( 300, 20 ) -- Y position of background
hudS.bgW, hudS.bgH = 0, 0
hudS.fX, hudS.fY = 339, 800  -- Y position of fill
hudS.fW, hudS.fH = 100, 190 
		
--dxDrawImage(hudS.bgX, hudS.bgY, hudS.bgW, hudS.bgH, myTexture["144"])
local currHeight = hudS.fH / 100 * getElementHealth(localPlayer) 
dxDrawImageSection(hudS.fX, hudS.fY + (hudS.fH - currHeight), hudS.fW-, currHeight, 0, currHeight, hudS.fW, currHeight, "heart.png", 0, 0, 0, tocolor(255,255,255,255), true)

 

Edited by raynner
Link to comment
46 minutes ago, raynner said:

acho que deve funcionar !
 


local hudS = {}
--hudS.bgX, hudS.bgY = ConvertAbsoluteToRelative( 300, 20 ) -- Y position of background
hudS.bgW, hudS.bgH = 0, 0
hudS.fX, hudS.fY = 339, 800  -- Y position of fill
hudS.fW, hudS.fH = 100, 190 
		
--dxDrawImage(hudS.bgX, hudS.bgY, hudS.bgW, hudS.bgH, myTexture["144"])
local currHeight = hudS.fH / 100 * getElementHealth(localPlayer) 
dxDrawImageSection(hudS.fX, hudS.fY + (hudS.fH - currHeight), hudS.fW-, currHeight, 0, currHeight, hudS.fW, currHeight, "heart.png", 0, 0, 0, tocolor(255,255,255,255), true)

 

not

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...