PDA

View Full Version : Function: WndResize hitTest setVisible Move


AGameAnx
07-31-2006, 01:56 PM
Here's some simple scripts i wrote.

Just for case you don't want to write these yourself everytime :)
These scripts apply to all object types.
You can rename these txt files to *.lua and use Application.LoadScript ;)

In window resize function i used these simple calculations (just to keep you notised):

--The function >
function resize(objects)
-- Pos
for index, object in objects do
if (object.xdist) then
*ObjectType*.SetPos(object.name, wndsize.Width-objects[index].xdist, *ObjectType*.GetPos(object.name).Y);
end
if (object.ydist) then
*ObjectType*.SetPos(object.name, *ObjectType*.GetPos(object).X, wndsize.Height-objects[index].ydist);
end
-- Size
if (object.xsize) then
*ObjectType*.SetSize(object.name, wndsize.Width-objects[index].xsize, *ObjectType*.GetSize(object.name).Height);
end
if (object.ysize) then
*ObjectType*.SetSize(object.name, *ObjectType*.GetSize(object).Width, wndsize.Height-objects[index].ysize);
end
end
If function will not recieve any of the values it will leave it as it is, as you can see :)