Jump to content

Directx functions again ..


Piorun

Recommended Posts

Posted

I have new problem now.

I want to move all of my static img which are in table and i want to do it softly, so im using onClientRender. Code:

function moveRight() 
for k,v in ipairs(charImage) do 
local move = 0 
local guiX, guiY = guiGetPosition(charImage[k],false) 
  
   function moveGUI() 
      move = move + 40 
      guiSetPosition(charImage[k],guiX + move, screenHeight - 120,false) 
      if move == 160 then 
         guiSetAlpha(charImage[k],0.5) 
         removeEventHandler("onClientRender", getRootElement(), moveGUI) 
      end 
   end 
   addEventHandler("onClientRender", getRootElement(), moveGUI) 
end 
end 

I fact only one img is moving correctly, but other are going far, far away ...

How to fix that?

Posted
function moveGUI() 
    for k,v in ipairs(charImage) do 
        local move = 0 
        local guiX, guiY = guiGetPosition(charImage[k],false) 
  
        move = move + 40 
        guiSetPosition(charImage[k],guiX + move, screenHeight - 120,false) 
        if move == 160 then 
            guiSetAlpha(charImage[k],0.5) 
            charImage[k] = nil 
        end 
    end 
end 
addEventHandler("onClientRender", getRootElement(), moveGUI) 

I don't know if that's what you wanted, neither if it's going to work correctly.

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