ZeyadGTX Posted September 18, 2014 Share Posted September 18, 2014 I drawn This Pic in my hud but i was asking can i make it rotates 360 Degrees And keep rotating ! dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png") Link to comment
MIKI785 Posted September 18, 2014 Share Posted September 18, 2014 The next parameter after "image" is actually the rotation.. Check dxDrawImage. Link to comment
Anubhav Posted September 19, 2014 Share Posted September 19, 2014 rot = 50 addEventHandler("onClientRender", root, function() if rot > 360 then state = 1 else state = 2 end if state ==1 then rot = rot-5 else rot = rot+5 end end ) dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) Not realy sure but shud worok Link to comment
#DRAGON!FIRE Posted September 19, 2014 Share Posted September 19, 2014 rot = 50 addEventHandler("onClientRender", root, function() if rot > 360 then state = 1 else state = 2 end if state ==1 then rot = rot-5 else rot = rot+5 end end ) dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) Not realy sure but shud worok why ? not need for this ! just create a var in start and make it like this rot = rot + 3 Link to comment
Saml1er Posted September 19, 2014 Share Posted September 19, 2014 1st method. local speed ,start = 4,getTickCount() addEventHandler("onClientRender", root, function() local rot = (((start - getTickCount())/1000)/60)/speed --[[ if you multiply speed with - 1 ( speed * -1 ) then the image might start rotating clockwise or anti-clockwise.]] dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) end ) 2nd method. local rot = 0 addEventHandler("onClientRender", root, function() local rot = rot + 0.1 dxDrawImage((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768)*sHeight, "heart.png", rot) end ) Link to comment
ZeyadGTX Posted September 19, 2014 Author Share Posted September 19, 2014 Thanks Guys I fixed it Link to comment
Anubhav Posted September 19, 2014 Share Posted September 19, 2014 Thanks Guys I fixed it No problem. 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