Changes

Jump to navigation Jump to search

on.resize

201 bytes added, 02:20, 16 January 2012
Line 12: Line 12:  
     theWidth = platform.window:width()
 
     theWidth = platform.window:width()
 
     theHeight = platform.window:height()
 
     theHeight = platform.window:height()
 +
end
 +
</source>
 +
 +
This is a better way, though :
 +
<source lang="lua">
 +
function on.resize(x, y) -- Yes, on.resize can pass the new width and height, so why not use it ;-)
 +
    theWidth = x
 +
    theHeight = y
 
end
 
end
 
</source>
 
</source>

Navigation menu