0 Members and 2 Guests are viewing this topic.
function on.arrowUp --what to do goes hereend
Here is a list of all of the keys that can be "controlled" with Lua
Quote from: apcalc on June 05, 2011, 06:31:24 pmHere is a list of all of the keys that can be "controlled" with LuaWhere is the list?
This: http://wiki.inspired-lua.org/Category:EventsSo on.down(), on.up(), on.left(), and on.right() are for touchpad motions. Right?
So it would go like this:The mouse is already controlled by the touchpad, no need to program this.on.mouseDown is when the mouse is clicked, it reports that it was clicked and at what coordinates it was clicked at. What is the syntax for on.mouseDown?
So on.mouseDown(n, m) will save the X coordinate to var n, Y coordinate to var m?Or does it have to store to vars x and y?
Quote from: Spyro543 on June 05, 2011, 07:00:32 pmSo on.mouseDown(n, m) will save the X coordinate to var n, Y coordinate to var m?Or does it have to store to vars x and y?Again ... you work in an evenmential environnement. Those questions are answered, please take the time to read everything.http://www.inspired-lua.org/category/tutorials/starting-in-lua/
function on.paint(gc) if mX and mY then gc:setPen("sansserif", "r", 18) gc:drawString("You pressed at ("..mx..", "..my..") coordinates", 0, 0, "top") endendfunction on.mouseDown(x, y) mX, mY = x, yend
function on.mouseDown(x, y) mX, mY = x, y platform.window:invalidate()end