papam77 Posted May 5, 2013 Share Posted May 5, 2013 Heyo guys, is possible to use file.gif as dxDrawImage? Or not? Link to comment
WASSIm. Posted May 5, 2013 Share Posted May 5, 2013 (edited) [url=https://wiki.multitheftauto.com/wiki/DxDrawGifImage]https://wiki.multitheftauto.com/wiki/DxDrawGifImage[/url] dxDrawGifImage Edited May 5, 2013 by Guest Link to comment
Cadu12 Posted May 5, 2013 Share Posted May 5, 2013 https://community.multitheftauto.com/index.php?p= ... ls&id=5832 You can use for it. Link to comment
50p Posted May 5, 2013 Share Posted May 5, 2013 I made an separate tool to generate sprites from gifs as well to help you out: viewtopic.php?f=108&t=49179&p=482290 Link to comment
papam77 Posted May 7, 2013 Author Share Posted May 7, 2013 Why it doesn't work ? addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawGifImage(704, 284, 96, 96, "loading.gif", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) Link to comment
فاّرس Posted May 7, 2013 Share Posted May 7, 2013 I'm do not know this function, addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawGifImage(704, 284, 96, 96, "loading", 0,"png",120) end ) function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) } ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) Try it ^ Link to comment
iPrestege Posted May 7, 2013 Share Posted May 7, 2013 Why it doesn't work ? addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() dxDrawGifImage(704, 284, 96, 96, "loading.gif", 0, 0, 0, tocolor(255, 255, 255, 255), true) end ) Because you forget to add the 'source function' . 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