Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
on.resize
317 bytes added
,
22:09, 3 September 2011
no edit summary
Line 3:
Line 3:
It has no argument.
It has no argument.
+
It's a good place to put your global window-size-related variable since this event only fires when the script's frame's size changes (see Example).
== Example ==
== Example ==
Line 9:
Line 10:
<source lang="lua">
<source lang="lua">
function on.resize() --Define a function for the event
function on.resize() --Define a function for the event
−
gc:drawLine
(
5,5,200,1
)
--Draw a line on the screen
+
theWidth = platform.window.width()
+
theHeight = platform.window.height
()
end
end
</source>
</source>
+
+
You can then refer to the height and the width of the widget by calling the global variables instead of the [[Catrgory:platform.window]] methods.
[[Category:Events]]
[[Category:Events]]
Adriweb
Bureaucrats
,
Administrators
935
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version