Changes
Jump to navigation
Jump to search
← Older edit
on.paint
369 bytes added
,
16:50, 17 December 2013
m
no edit summary
Line 1:
Line 1:
−
The function '''on.paint'''(''[[:Category:gc|gc]]'') is called when the script's window needs to be painted.
+
The function '''on.paint'''(''[[:Category:gc|gc]]'') is called when the script's window needs to be painted.
<br />
''[[:Category:gc|'gc']]'' is the Graphics Context, passed by default to the function.
''[[:Category:gc|'gc']]'' is the Graphics Context, passed by default to the function.
+
This function can be flagged to fire by calling the [[platform.window:invalidate]] function.
+
== Example ==
+
+
Below is an example of a program that uses on.paint(gc) to draw a line to the screen:
+
<source lang="lua">
+
function on.paint(gc) --Define a function for the event with the default argument
+
gc:drawLine(5,5,200,1) --Draw a line on the screen
+
end
+
</source>
[[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