Jump to content

dxDrawImage


Recommended Posts

13 minutes ago, -Ilker. said:

شوف الموضوع الي عطيتك اياه وجربه

اي جزء اخذ منه

 

     function isMouseInPosition ( x, y, width, height )
        if ( not isCursorShowing ( ) ) then
            return false
        end
     
    	local sx,sy  = guiGetScreenSize()
        local cx, cy = getCursorPosition ( )
        local cx, cy = ( cx * sx ), ( cy * sy )
        if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
            return true
        else
            return false
        end
    end

    local statButton = { } 
    addEvent ( "onButtonDxClick" , true ) 
    function dxCreateButton ( element,x,y,w,h,text )
    if ( not element or type ( element ) ~= "string" ) then return end 
    if ( not statButton[element] ) then statButton[element] = "up" end 
    if ( isMouseInPosition(x,y,w,h) ) then
    if ( getKeyState ( "mouse1" ) ) then 
    if ( statButton[element] ~= "down" ) then 
    statButton[element] = "down"
    triggerEvent ( "onButtonDxClick" , localPlayer , element , text )
    end 
    else 
    if ( statButton[element] == "down" ) then 
    statButton[element] = "up"
    end
    end
    end
    dxDrawRectangle ( x , y , w , h , tocolor(0,0,0,200) , false ) 
    dxDrawText ( text or "" , x,y,x+w,y+h,tocolor(255,255,255,255),1,"default-bold","center","center",false,false,false,true)
    end 

    --- # Example 

    addEventHandler ( "onClientRender" , root , function ( ) 
    dxCreateButton ( "kill" , 300,300,120,30,"Kill Player" )
    dxCreateButton ( "warp" , 300,350,120,30,"Teleport Player" )
    end ) 

    addEventHandler ( "onButtonDxClick" , localPlayer , function ( Button , Text ) 
    if ( Button == "kill" ) then 
    outputChatBox(Text)
    elseif ( Button == "warp" ) then 
    setElementPosition ( localPlayer ,0,0,3)
    end
    end )

 

Link to comment
21 minutes ago, -Ilker. said:

من السطر الاول إلى ال 35 

والي تحت مثال عليها انا حاط

ضبط لكن وقت مايطلع سهم بسبب الوحه ما اقدر اسكرها

لازم افتح لوحه ثانيه واسكر الوحه الاولى بالسهم حق اللوحه الثانيه

يعني السهم حق الوحه الاصليه مايسكر

Link to comment
32 minutes ago, MohamedSead said:

هذا اللي انا مسويه وقت ماتطلع الوحه

لكن ماله فايده

يعني وقت ما اضغط فيه الازرار مايسوي شي

لازم سهم من لوحه ثانيه

طيب جرب دا حطه مع قفل اللوحه

guiSetInputEnabled(false)

 

Edited by #\_oskar_/#
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...