Jump to content

Rotate image


ZeyadGTX

Recommended Posts

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

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

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