NETCHK Posted September 21, 2017 Share Posted September 21, 2017 sorry my photoshop have a error, I used Paint 3D kkk OK I need a help to create system is life heart person, for on life full and empty, 100% IMAGE SELECTION CUT == 50% life == 0% local life = getElementHealt(source) dxdrawimagesection() -- help ? Link to comment
raynner Posted September 21, 2017 Share Posted September 21, 2017 (edited) 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 September 21, 2017 by raynner Link to comment
NETCHK Posted September 22, 2017 Author Share Posted September 22, 2017 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
raynner Posted September 22, 2017 Share Posted September 22, 2017 Just now, NETCHK said: Is it the same as the heart system I did in the picture? give-me your line dxDrawImageSection and pixel your image Link to comment
NETCHK Posted September 22, 2017 Author Share Posted September 22, 2017 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
raynner Posted September 22, 2017 Share Posted September 22, 2017 (edited) 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 September 22, 2017 by raynner Link to comment
NETCHK Posted September 22, 2017 Author Share Posted September 22, 2017 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
DNL291 Posted September 22, 2017 Share Posted September 22, 2017 Type /debugscript 3 and make sure there's no errors with your code. Also, please show your code here so we can see what's wrong. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now