Jump to content

Help with HUD


MAB

Recommended Posts

I usually don't provide examples, but here you go;

Meta.xml

    

Client.lua

local screenW, screenH = guiGetScreenSize() 
local guiFillScroller = guiCreateScrollBar(832, 371, 256, 20, true, false) 
guiScrollBarSetScrollPosition(guiFillScroller, 100) 
  
local dx_UVWidth = 256 
local dx_UVHeight = 256 
  
showCursor(true) 
  
function StartDrawing() 
    dxDrawImageSection(0.4333333333333333*screenW, 0.3074074074074074*screenH, 256, dx_UVHeight*-1, 0, 0, 256, dx_UVHeight*-1, "CircleFill.png", 0, 0, 0, tocolor(187, 0, 0, 220), false) 
    dxDrawImage(0.4333333333333333*screenW, 0.0703703703703704*screenH, 256, 256, "CircleOutline.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    dxDrawText("Fill Value: "..tostring(dx_UVHeight), 0.4338541666666667*screenW, 0.3203703703703704*screenH, 0.5666666666666667*screenW, 0.3388888888888889*screenH, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) 
end 
addEventHandler("onClientRender", root, StartDrawing) 
  
function DetectGUIScrolled(theScroller) 
    local theValue = (guiScrollBarGetScrollPosition(theScroller)*2.56) -- Since the texture is 256x256, we want 100% to be 256. 
    dx_UVHeight = theValue 
end 
addEventHandler("onClientGUIScroll", root, DetectGUIScrolled) 

Images

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