Ahmed Ly Posted June 24, 2016 Share Posted June 24, 2016 السلام عليكم كل عام و انتم بخير نبي نعرف كييف نغير شكل ScrollBar ؟ Link to comment
</Mr.Tn6eL> Posted June 24, 2016 Share Posted June 24, 2016 يبغالها شوي حسابات dxDrawRectangle getCursorPosition getKeyState guiGetScreenSize getDistanceBetweenPoints2D Link to comment
N3xT Posted June 24, 2016 Share Posted June 24, 2016 يبغالها شوي حسابات dxDrawRectangle getCursorPosition getKeyState guiGetScreenSize getDistanceBetweenPoints2D عندي إستفسار بسيط : ليه راح يحتاج getCursorPosition Link to comment
</Mr.Tn6eL> Posted June 24, 2016 Share Posted June 24, 2016 يبغالها شوي حسابات dxDrawRectangle getCursorPosition getKeyState guiGetScreenSize getDistanceBetweenPoints2D عندي إستفسار بسيط : ليه راح يحتاج getCursorPosition عشان يجيب احداثيات الماوس ويخلي مربع السكرول بار يتحرك Link to comment
Ahmed Ly Posted June 24, 2016 Author Share Posted June 24, 2016 يبغالها شوي حسابات dxDrawRectangle getCursorPosition getKeyState guiGetScreenSize getDistanceBetweenPoints2D ممكن مثل Link to comment
</Mr.Tn6eL> Posted June 24, 2016 Share Posted June 24, 2016 ممكن مثل اضغط على الوظيفة للمثال Link to comment
#Soking Posted June 24, 2016 Share Posted June 24, 2016 getDistanceBetweenPoints2D ليه ؟ Link to comment
</Mr.Tn6eL> Posted June 24, 2016 Share Posted June 24, 2016 getDistanceBetweenPoints2D ليه ؟ فايدتها تحسب progress 0-100 Link to comment
Abdul KariM Posted June 24, 2016 Share Posted June 24, 2016 شف المسألة يبيلها شوية حسابات شوف المثال وحاول تطبق عليه طلبك function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end scrollbar = guiCreateScrollBar(0.29, 0.44, 0.39, 0.05, true, true) guiSetVisible ( scrollbar , false ) guiSetAlpha ( scrollbar , 0 ) local screenW, screenH = guiGetScreenSize() local x_, y_ = ( screenW / 800 ), ( screenH / 600 ) local x = 0 function Scr() local x__ = x + 269 dxDrawLine(screenW * 0.3337, screenH * 0.4750, screenW * 0.6275, screenH * 0.4750, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(screenW * 0.3337, screenH * 0.4750, screenW * 0.3337, screenH * 0.5067, tocolor(255, 255, 255, 255), 1, true) dxDrawRectangle( x_*x__ , y_*285, x_*17, y_*20, tocolor(0, 0, 0, 255), false) dxDrawLine(screenW * 0.6275, screenH * 0.4750, screenW * 0.6275, screenH * 0.5083, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(screenW * 0.3337, screenH * 0.5083, screenW * 0.6275, screenH * 0.5083, tocolor(255, 255, 255, 255), 1, true) end bindKey ( "f3","down",function ( ) if isEventHandlerAdded ( "onClientRender", root , Scr ) then removeEventHandler ( "onClientRender", root , Scr ) guiSetVisible ( scrollbar , false ) showCursor ( false ) else addEventHandler("onClientRender", root,Scr) guiSetVisible ( scrollbar , true ) showCursor ( true ) end end ) addEventHandler("onClientGUIScroll",getRootElement(), function ( ) if ( source == scrollbar ) then Pos = guiScrollBarGetScrollPosition ( scrollbar ) x = Pos * 2.17 end end ) Link to comment
Ahmed Ly Posted June 25, 2016 Author Share Posted June 25, 2016 شف المسألة يبيلها شوية حسابات شوف المثال وحاول تطبق عليه طلبك function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end scrollbar = guiCreateScrollBar(0.29, 0.44, 0.39, 0.05, true, true) guiSetVisible ( scrollbar , false ) guiSetAlpha ( scrollbar , 0 ) local screenW, screenH = guiGetScreenSize() local x_, y_ = ( screenW / 800 ), ( screenH / 600 ) local x = 0 function Scr() local x__ = x + 269 dxDrawLine(screenW * 0.3337, screenH * 0.4750, screenW * 0.6275, screenH * 0.4750, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(screenW * 0.3337, screenH * 0.4750, screenW * 0.3337, screenH * 0.5067, tocolor(255, 255, 255, 255), 1, true) dxDrawRectangle( x_*x__ , y_*285, x_*17, y_*20, tocolor(0, 0, 0, 255), false) dxDrawLine(screenW * 0.6275, screenH * 0.4750, screenW * 0.6275, screenH * 0.5083, tocolor(255, 255, 255, 255), 1, false) dxDrawLine(screenW * 0.3337, screenH * 0.5083, screenW * 0.6275, screenH * 0.5083, tocolor(255, 255, 255, 255), 1, true) end bindKey ( "f3","down",function ( ) if isEventHandlerAdded ( "onClientRender", root , Scr ) then removeEventHandler ( "onClientRender", root , Scr ) guiSetVisible ( scrollbar , false ) showCursor ( false ) else addEventHandler("onClientRender", root,Scr) guiSetVisible ( scrollbar , true ) showCursor ( true ) end end ) addEventHandler("onClientGUIScroll",getRootElement(), function ( ) if ( source == scrollbar ) then Pos = guiScrollBarGetScrollPosition ( scrollbar ) x = Pos * 2.17 end end ) يا ريت تشرح عن كودك لاني مافهمت شي Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now