Jump to content

GUI Element movement


Recommended Posts

If your'e doing it for an image you can use this:

So, moving a gui with guiSetPosition and timers.

  
  
function do_moveing() 
local width, height = guiGetScreenSize () 
local offset = width/480 
image = guiCreateStaticImage(-290, -10, 283, 175, "trollface.jpg", false) 
move_timer = setTimer ( move, 50, 480, offset ) 
setTimer ( delete, 25000, 1 ) 
end 
  
  
function move ( offset ) 
local x, y = guiGetPosition ( image, false ) 
local newpos = x + offset + 0.85 
guiSetPosition ( image, newpos, -10, false ) 
end 
  
function delete () 
destroyElement (image) 
killTimer ( move_timer ) 
end 
  

[ This is moving the image above your'e screen ]

Link to comment
If your'e doing it for an image you can use this:

So, moving a gui with guiSetPosition and timers.

  
  
function do_moveing() 
local width, height = guiGetScreenSize () 
local offset = width/480 
image = guiCreateStaticImage(-290, -10, 283, 175, "trollface.jpg", false) 
move_timer = setTimer ( move, 50, 480, offset ) 
setTimer ( delete, 25000, 1 ) 
end 
  
  
function move ( offset ) 
local x, y = guiGetPosition ( image, false ) 
local newpos = x + offset + 0.85 
guiSetPosition ( image, newpos, -10, false ) 
end 
  
function delete () 
destroyElement (image) 
killTimer ( move_timer ) 
end 
  

[ This is moving the image above your'e screen ]

will it keep moving or stop on an point ? , like this

Mobilephone-GTA4.jpg

it show up, .. up and down , if you closed it , it will move down , if you opened it , it will move up and something like that thanks anyway

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