Jump to content

dxDrawText


Newbie

Recommended Posts

  
buton = guiCreateButton(x/1.7, y/3.55, 55, 15, "Button") 
guiSetAlpha(buton , 0) 
  
 addEventHandler ( "onClientGUIClick", buton,  
function() 
--Blba bla bla 
end) 

@Golanu, he wants for dxDraw not for GUI.

@Newbie i suggest you to create a guiLabel, and then use onClientGUIClick to check when the player click on the label, if you want show a window or a gui element then use guiSetVisible.

Example:

  
local myLabel = guiCreateLabel  ( x, y, width, height, "text", true ) 
local myWindow = guiCreateWindow ( x, y, width, height, "Information", true ) 
guiSetVisible(myWindow, false) 
  
function onClick() 
guiSetVisible(myWindow, true) 
end 
addEventHandler("onClientGUIClick", root, onClick) 

Link to comment

Nikolai just don't write if you don't have any clue.

@Newbie, i would recommened you BlanK9's example.

Or you could do some maths:

  
addEventHandler("onClientClick",root, 
    function(b,state) 
        if state == down then -- check if  the state is down , otherwise it triggers this function 2 times (up and down) 
            if isMouseWithinRangeOf(x/1.7,55,y/3.55,15) then -- your dx drawn text. 
                ....-- your code. 
            end 
        end 
end 
) 
                 
  
function isMouseWithinRangeOf(psx,pssx,psy,pssy) 
  if isCursorShowing() == false then 
    return false 
  end 
  local cx,cy = getCursorPosition() 
  cx,cy = cx*x,cy*y 
  if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then 
    return true,cx,cy 
  else 
    return false 
  end 
end 

Hope that helps you.

Edited by Guest
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...