Zinjaaa Posted July 29, 2013 Share Posted July 29, 2013 (edited) As I can add this feature to my panel (InterpolateBetween) Example Press O OutBounce effect (Open) Press O OutBounce effect (Close) My client local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage ( 240, 145, 550, 480, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("O", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) else isPlayerViewingPanel = true showCursor (true) end end ) I want Effect ''OutBounce" You can create example without using wikipedia? I really do not know much about the example of wikipedia I do not understand much this. Greetings! att: Zinjaaa Edited July 30, 2013 by Guest Link to comment
Castillo Posted July 29, 2013 Share Posted July 29, 2013 We don't accept requests here, try to do it yourself, then request for help if you fail to do so. Link to comment
Zinjaaa Posted July 30, 2013 Author Share Posted July 30, 2013 We don't accept requests here, try to do it yourself, then request for help if you fail to do so. Modify the poster think that you can help. Link to comment
Sasu Posted July 30, 2013 Share Posted July 30, 2013 function dxDrawAnimWindow(text,alto,ancho,color,font,anim) --dxDrawAnimWindow(tittle, height, width, color, font, anim( easing value ) local x,y = guiGetScreenSize() btAncho = ancho btAlto = alto/20 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, anim) local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btAncho, btAlto, btAlto/11, progress, anim) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawRectangle ( posx, posy-y2, x2, y2, color ) dxDrawRectangle ( posx, posy, x1, y1, tocolor ( 0, 0, 0, 200 ) ) dxDrawText ( text, 0, -(y1)-y2, x, y, tocolor ( 255, 255, 255, 255 ), z2, font,"center","center") --For more information of animation, visit the next page: [url=https://wiki.multitheftauto.com/wiki/Easing]https://wiki.multitheftauto.com/wiki/Easing[/url] end This function was made by @Bc# : viewtopic.php?f=146&t=61065 Link to comment
Zinjaaa Posted July 31, 2013 Author Share Posted July 31, 2013 I really tried to use this, do not know if can you take the proper and necessary You can take just and necessary for my panel. You can add me in skype To discuss this topic please zinja_95 Link to comment
Bc# Posted July 31, 2013 Share Posted July 31, 2013 local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function main ( ) if isPlayerViewingPanel then start = getTickCount() addEventHandler ( "onClientRender", root, dxDrawTheImage ) end end function dxDrawTheImage() x,y = guiGetScreenSize() ancho=550 alto=480 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, OutBounce) posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawImage ( posx, posy-y2, x2, y2, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end bindKey("O", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) else isPlayerViewingPanel = true showCursor (true) end end ) You'll have to do something how this, this is not tested, so you'll have to see if it has a bug. Link to comment
Zinjaaa Posted July 31, 2013 Author Share Posted July 31, 2013 I think it has a bug, does not work when pressing "O". Link to comment
Sasu Posted July 31, 2013 Share Posted July 31, 2013 You'll have to do something how this, this is not tested, so you'll have to see if it has a bug. Try this: local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() start = getTickCount() end ) function main ( ) if isPlayerViewingPanel then addEventHandler ( "onClientRender", root, dxDrawTheImage ) else removeEventHandler("onClientRender", root, dxDrawTheImage) end end function dxDrawTheImage() x,y = guiGetScreenSize() ancho=550 alto=480 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, "OutBounce") posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawImage ( posx, posy-y2, x2, y2, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end bindKey("O", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) main() else isPlayerViewingPanel = true showCursor (true) main() end end ) Link to comment
Zinjaaa Posted July 31, 2013 Author Share Posted July 31, 2013 Now the panel is not working any other help please ? Link to comment
Moderators IIYAMA Posted July 31, 2013 Moderators Share Posted July 31, 2013 any errors? /debugscript 3 Link to comment
xXMADEXx Posted August 1, 2013 Share Posted August 1, 2013 I have fixed the script on my local server. (the Y in dxDrawImage might need a little adjusting) local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() function main ( ) if isPlayerViewingPanel then start = getTickCount() addEventHandler ( "onClientRender", root, dxDrawTheImage ) else removeEventHandler("onClientRender", root, dxDrawTheImage) end end function dxDrawTheImage() x,y = guiGetScreenSize() ancho=550 alto=480 local now = getTickCount() local elapsedTime = now - start local endTime = start + 1500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, ancho, alto, 255, progress, "OutBounce") local x2, y2, z2 = interpolateBetween ( 0, 0, 0, ancho, alto, alto/11, progress, 'OutBounce') posx = (x/2)-(x1/2) posy = (y/2)-(y1/2) dxDrawImage ( posx, posy-y2/2, x2, y2, "window.png" ) dxDrawText ( "Rules", sw/2 - 26, sh/2 - 230, sw/2 + 175, sh/2 + 80, tocolor ( 255, 255, 255, 255 ), 1.6, "default-bold") end bindKey("O", "down",function() if ( isPlayerViewingPanel == true ) then isPlayerViewingPanel = false showCursor (false) main() else isPlayerViewingPanel = true showCursor (true) main() 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