Jump to content

partial circle


Whit3

Recommended Posts

Posted

This script work just in 1 resolution ( 1280x1024 ) in the other one the circle are moved or larger

What's the problem?

local rx,cx = guiGetScreenSize() 
local posx = 0.129 * rx  
local posy = 0.837 * cx  
local size = 0.116 * cx  
  
  
function healthstatus ( ) 
  local target = getCameraTarget() 
  if not target then return end 
  if not (getElementType(target) == "vehicle") then return end 
  local car = target 
    if ( isPedInVehicle ( localPlayer ) == false ) then return false end 
    local health = getElementHealth ( car ) 
    local name = getVehicleName ( car ) 
    local currenthealth = math.max(health - 250, 0)/750 
    dxDrawPartialCircle(posx, posy, size,2,0,currenthealth*360)  
end 
addEventHandler ( "onClientRender", root, healthstatus ) 

Posted

He is saying that the circle is just moved and different sizes, not that the function isn't working.

You have to use the function guiGetScreenSize with some basic math to make it the same size & same position in all resolutions.

  • Moderators
Posted
This script work just in 1 resolution ( 1280x1024 )

Are you sure about the resolution ? Because I tried a lot of settings for 1280x1024, and this is the best I got so far:

412694e8f977aa51613215722851ca97.png

So please check again for which resolution, this script works, and also check in video settings the HUD Match aspect ratio check box (activated or not) and the Aspect Ratio (if it's auto, please select a real one that work, so I can set the same in my settings).

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