Jump to content

شباب


Recommended Posts

15 minutes ago, AchrefF said:

شباب ازاى اعمل زر فى لوحه

DX

بعرف اعمل زر مخفى بس عوز زر اول ما اشاور عليه ب الماوس يقلب لون تانى

 

dxCreateButton
"onClientMouseEnter"
"onClientMouseLeave"

 

Edited by Killer Project
event
  • Like 1
Link to comment

استخدام

cursorPosition
--
dxDrawBorderedText 
--

function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
    local wh = 1
    local msg_gsub = text
    if type(text) == 'string' then
    msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) 
    end
    dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black
    dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
end

function cursorPosition(x, y, w, h)
	if (not isCursorShowing()) then
		return false
	end
	local mx, my = getCursorPosition()
	local fullx, fully = guiGetScreenSize()
	cursorx, cursory = mx*fullx, my*fully
	if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
		return true
	else
		return false
	end
end
--Event 

"onClientRender" 
-- مثال 
sx_, sy_ = guiGetScreenSize ( )
sx, sy = sx_ / 1280, sy_ / 720


function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
    local wh = 1
    local msg_gsub = text
    if type(text) == 'string' then
    msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) 
    end
    dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black
    dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
end

			 font2 = dxCreateFont("Dragon.ttf",10)

lol = { }
    function  Dx ()
	lol[1] =  tocolor(0, 0, 0, 0)
	lol[2] = tocolor(0, 0, 0, 0)
	if ( cursorPosition(sx*343,sy*489,sx*94,sy*46) ) then 	lol[1] =  tocolor(82,137,153) end 
    if ( cursorPosition(sx*561,sy*489,sx*94,sy*46) ) then lol[2] =  tocolor(82,137,153) end 
        dxDrawLine(sx*282 - 1,sy*249 - 1,sx*282 - 1,sy*553, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*249 - 1,sx*282 - 1,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*282 - 1,sy*553,sx*769,sy*553, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*553,sx*769,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*282,sy*249,sx*487,sy*304, tocolor(80, 173, 163, 87), false)
        dxDrawLine(sx*281 - 1,sy*248 - 1,sx*281 - 1,sy*282, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*248 - 1,sx*281 - 1,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*281 - 1,sy*282,sx*769,sy*282, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*282,sx*769,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*281,sy*248,sx*488,sy*34, tocolor(58, 133, 196,255), false)
        dxDrawBorderedText("",sx*288,sy*329,sx*365,sy*376, tocolor(68, 34, 218, 254), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*288,sy*390,sx*365,sy*437, tocolor(118, 43, 210, 255), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawLine(sx*343 - 1,sy*489 - 1,sx*343 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*437,sy*489 - 1,sx*343 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*343 - 1,sy*535,sx*437,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*437,sy*535,sx*437,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*343,sy*489,sx*94,sy*46,lol[1], false)
        dxDrawLine(sx*561 - 1,sy*489 - 1,sx*561 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*655,sy*489 - 1,sx*561 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*561 - 1,sy*535,sx*655,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*655,sy*535,sx*655,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*561,sy*489,sx*94,sy*46,lol[2], false)
        dxDrawBorderedText("",sx*345,sy*492,sx*437,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*563,sy*492,sx*655,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*332,sy*252,sx*692,sy*277, tocolor(121, 216, 28, 255), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText(" ",sx*377,sy*377,sx*542,sy*390, tocolor(255, 255, 255, 255), 1.00,font2, "left", "top",false, false, false, true, true)
    end
addEventHandler("onClientRender", root,Dx)

 

  • Like 1
Link to comment
13 minutes ago, Ahmed Ly said:

استخدام


cursorPosition
--
dxDrawBorderedText 
--

function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
    local wh = 1
    local msg_gsub = text
    if type(text) == 'string' then
    msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) 
    end
    dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black
    dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
end

function cursorPosition(x, y, w, h)
	if (not isCursorShowing()) then
		return false
	end
	local mx, my = getCursorPosition()
	local fullx, fully = guiGetScreenSize()
	cursorx, cursory = mx*fullx, my*fully
	if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
		return true
	else
		return false
	end
end
--Event 

"onClientRender" 
-- مثال 
sx_, sy_ = guiGetScreenSize ( )
sx, sy = sx_ / 1280, sy_ / 720


function dxDrawBorderedText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
    local wh = 1
    local msg_gsub = text
    if type(text) == 'string' then
    msg_gsub = text:gsub ( '#%x%x%x%x%x%x', '' ) 
    end
    dxDrawText ( msg_gsub, x - wh, y - wh, w - wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false ) -- black
    dxDrawText ( msg_gsub, x + wh, y - wh, w + wh, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y + wh, w - wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y + wh, w + wh, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x - wh, y, w - wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x + wh, y, w + wh, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y - wh, w, h - wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( msg_gsub, x, y + wh, w, h + wh, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false )
    dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, color2 )
end

			 font2 = dxCreateFont("Dragon.ttf",10)

lol = { }
    function  Dx ()
	lol[1] =  tocolor(0, 0, 0, 0)
	lol[2] = tocolor(0, 0, 0, 0)
	if ( cursorPosition(sx*343,sy*489,sx*94,sy*46) ) then 	lol[1] =  tocolor(82,137,153) end 
    if ( cursorPosition(sx*561,sy*489,sx*94,sy*46) ) then lol[2] =  tocolor(82,137,153) end 
        dxDrawLine(sx*282 - 1,sy*249 - 1,sx*282 - 1,sy*553, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*249 - 1,sx*282 - 1,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*282 - 1,sy*553,sx*769,sy*553, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*553,sx*769,sy*249 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*282,sy*249,sx*487,sy*304, tocolor(80, 173, 163, 87), false)
        dxDrawLine(sx*281 - 1,sy*248 - 1,sx*281 - 1,sy*282, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*248 - 1,sx*281 - 1,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*281 - 1,sy*282,sx*769,sy*282, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*769,sy*282,sx*769,sy*248 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*281,sy*248,sx*488,sy*34, tocolor(58, 133, 196,255), false)
        dxDrawBorderedText("",sx*288,sy*329,sx*365,sy*376, tocolor(68, 34, 218, 254), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*288,sy*390,sx*365,sy*437, tocolor(118, 43, 210, 255), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawLine(sx*343 - 1,sy*489 - 1,sx*343 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*437,sy*489 - 1,sx*343 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*343 - 1,sy*535,sx*437,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*437,sy*535,sx*437,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*343,sy*489,sx*94,sy*46,lol[1], false)
        dxDrawLine(sx*561 - 1,sy*489 - 1,sx*561 - 1,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*655,sy*489 - 1,sx*561 - 1,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*561 - 1,sy*535,sx*655,sy*535, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(sx*655,sy*535,sx*655,sy*489 - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(sx*561,sy*489,sx*94,sy*46,lol[2], false)
        dxDrawBorderedText("",sx*345,sy*492,sx*437,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*563,sy*492,sx*655,sy*535, tocolor(112, 217, 75, 247), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText("",sx*332,sy*252,sx*692,sy*277, tocolor(121, 216, 28, 255), 1.00,font2, "center", "center", false, false, false, true, false)
        dxDrawBorderedText(" ",sx*377,sy*377,sx*542,sy*390, tocolor(255, 255, 255, 255), 1.00,font2, "left", "top",false, false, false, true, true)
    end
addEventHandler("onClientRender", root,Dx)

 

شكرا على المساعده

28 minutes ago, Killer Project said:

dxCreateButton
"onClientMouseEnter"
"onClientMouseLeave"

 

شكرا اخى

Link to comment

سوي 

dxDrawRectangle
في فنكشن و سو لها رندر
addEventHandler("onClientRender",....
  و سوي حدث onClientClick
  وسوي تحقق للماوس
  وتحقق لإحداثيات الـdxDrawRectangle
  بس لو تبي شي نظيف سوي فنكشي بسيط تغير فيه اسم الفنكشن ويبقى بنفس المفعول
  
  مثآل :
  function dxDrawButton(x,w,y,h,color,PostGUI)
    dxDrawRectangle(x,w,y,h,color,PostGUI)
    end
  

 

Link to comment
8 minutes ago, coNolel said:

سوي 


dxDrawRectangle
في فنكشن و سو لها رندر
addEventHandler("onClientRender",....
  و سوي حدث onClientClick
  وسوي تحقق للماوس
  وتحقق لإحداثيات الـdxDrawRectangle
  بس لو تبي شي نظيف سوي فنكشي بسيط تغير فيه اسم الفنكشن ويبقى بنفس المفعول
  
  مثآل :
  function dxDrawButton(x,w,y,h,color,PostGUI)
    dxDrawRectangle(x,w,y,h,color,PostGUI)
    end
  

 

شكرا اخى على الافاده

  • Like 1
Link to comment
7 hours ago, AchrefF said:

بعرف اعمل زر مخفى بس عوز زر اول ما اشاور عليه ب الماوس يقلب لون تانى

 

4 hours ago, Abu-Solo said:

يقدر يسوي زرار عادي ويحط الالفا علي صفر ,

guiSetAlpha(button,0)

ايش وضعك ؟

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