Jump to content

[HELP] Circle Health Bar


@RUSH

Recommended Posts

Posted (edited)

Hello friends. am new to creating HUD dx. i want to know how to make this animation health and armor. it is not used dx circle. please give me functions or application in shader

Exemplo:

Qc891Xs.png 

sQ9gDxJ.png

Edited by @RUSH
Posted
3 minutes ago, NeXuS™ said:

am new to creating HUD dx. i want to know how to make this animation health and armor. it is not used dx circle. please give me functions or application in shader

Posted
Just now, NeXuS™ said:

Como você sabe se não usa essa função ou sombreador?

I've used too much dxDrawCircle and already tried, it is not with him that does this, try and see
 

Posted
14 minutes ago, NeXuS™ said:

Just download the example given there, and understand the code there.

this will not help you. he does not know anything about it. and neither for me. please create an example for the staff to be able to understand. This will help a lot of people here. Thanks

Posted
9 hours ago, @RUSH said:

Hello friends. am new to creating HUD dx. i want to know how to make this animation health and armor. it is not used dx circle. please give me functions or application in shader

Exemplo:

Qc891Xs.png 

sQ9gDxJ.png

Use DxDrawImageSection.

Posted
local sWidth, sHeight = guiGetScreenSize()
local hud = {}

hud.bgHpX = sWidth - 200
hud.bgHpY = 20
hud.bgHpW = 50 -- pixels img
hud.bgHpH = 50 -- pixels img

hud.HpX = sWidth - 195.5
hud.HpY = 65
hud.HpW = 42 -- pixels img
hud.HpH = 42 -- pixels img

function onClientRender()
	dxDrawImage(hud.bgHpX, hud.bgHpY, hud.bgHpW, hud.bgHpH, "design/hp_bg.png") -- background hp

	local hp = getElementHealth(getLocalPlayer())
	local hpHeigth = hud.HpH / 100 * (hp)
	dxDrawImageSection(hud.HpX, hud.HpY, hud.HpW, -hpHeigth, 0, 0, hud.HpW, -hpHeigth, "design/hp_full.png", 0, 0, 0, 0x50FF0000, false)
end
addEventHandler("onClientRender", root, onClientRender)

Here is an example.

 

Posted
2 hours ago, MainSCR said:

local sWidth, sHeight = guiGetScreenSize()
local hud = {}

hud.bgHpX = sWidth - 200
hud.bgHpY = 20
hud.bgHpW = 50 -- pixels img
hud.bgHpH = 50 -- pixels img

hud.HpX = sWidth - 195.5
hud.HpY = 65
hud.HpW = 42 -- pixels img
hud.HpH = 42 -- pixels img

function onClientRender()
	dxDrawImage(hud.bgHpX, hud.bgHpY, hud.bgHpW, hud.bgHpH, "design/hp_bg.png") -- background hp

	local hp = getElementHealth(getLocalPlayer())
	local hpHeigth = hud.HpH / 100 * (hp)
	dxDrawImageSection(hud.HpX, hud.HpY, hud.HpW, -hpHeigth, 0, 0, hud.HpW, -hpHeigth, "design/hp_full.png", 0, 0, 0, 0x50FF0000, false)
end
addEventHandler("onClientRender", root, onClientRender)

Here is an example.

 

Not is imageselection my friend.

Posted
2 minutes ago, CodyJ(L) said:

A shader would perform a thousand times better then using dxDraw.

Of course, but can also do with dxDraw.

Posted
1 hour ago, MainSCR said:

WFuEhQAaT4eqVi44pAXLAw.jpg

 

HUD from my old server

That isnt what he is trying to achieve. He is trying to do it that the angle drawn means the health.

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