AnubisTCP
05-23-2006, 03:25 AM
I may be going about this all wrong but here it it goes.
I'm trying to emulate a program that was done in flash. After a minute of inactivity this program will display an image and move it from upper left corner to lower right corner until the image has been clicked on. (Screen saver sorta thing) Now I can make the image move easily enough, however since it's in a loop nothing else can be done while the loop is going.
pg = Page.GetFocus();
while (pg == "Page1") do
min = 0; -- The number to start at
max = 100; -- The number to stop at
step = .1; -- The number to count by (in this case 0, 2, 4, ...)
for count = min, max, step do
Image.SetPos("Image1", 4 * count, 3 * count);
end
min = 0; -- The number to start at
max = 100; -- The number to stop at
step = -.1; -- The number to count by (in this case 0, 2, 4, ...)
for count = max, min, step do
Image.SetPos("Image1", 4 * count, 3 * count);
end
end
This code moves a 400x300 image from corner to corner in a 800x600 project. Any way to check for a mouse click on the image while in the loop? Or a better way to move the image(or any object)?
TIA
PS - Also to note, the image doesn't seem to move steadily as one would expect in an incremental loop. After about 2 secs in speeds up slightly, odd thats all.
I'm trying to emulate a program that was done in flash. After a minute of inactivity this program will display an image and move it from upper left corner to lower right corner until the image has been clicked on. (Screen saver sorta thing) Now I can make the image move easily enough, however since it's in a loop nothing else can be done while the loop is going.
pg = Page.GetFocus();
while (pg == "Page1") do
min = 0; -- The number to start at
max = 100; -- The number to stop at
step = .1; -- The number to count by (in this case 0, 2, 4, ...)
for count = min, max, step do
Image.SetPos("Image1", 4 * count, 3 * count);
end
min = 0; -- The number to start at
max = 100; -- The number to stop at
step = -.1; -- The number to count by (in this case 0, 2, 4, ...)
for count = max, min, step do
Image.SetPos("Image1", 4 * count, 3 * count);
end
end
This code moves a 400x300 image from corner to corner in a 800x600 project. Any way to check for a mouse click on the image while in the loop? Or a better way to move the image(or any object)?
TIA
PS - Also to note, the image doesn't seem to move steadily as one would expect in an incremental loop. After about 2 secs in speeds up slightly, odd thats all.