- EXAMPLES
- Example 1
Code: Select all
local click = API.load("click")
click.setCursor()
- Example 2
Code: Select all
local click = API.load("click")
click.setCursor()
function onTick()
if click.hold then
click.setCursor("Goomba.png")
NPC.spawn(1,click.sceneX,click.sceneY,player.section)
else
click.setCursor("click/example.png")
end
end
- Example 3
Code: Select all
local click = API.load("click")
click.setCursor("Goomba.png")
click.setCursorOff()
function onTick()
if click.click() then
click.setCursorOn()
click.setCursorOff(15)
NPC.spawn(1,click.sceneX,click.sceneY,player.section)
end
end
- Example 4
Code: Select all
local click = API.load("click")
click.setCursor()
function onTick()
for k,v in pairs(NPC.get()) do
v.speedX = (click.sceneX - v.x)/50
v.speedY = (click.sceneY - v.y)/50
end
end
- Example 5
Code: Select all
local click = API.load("click")
click.setCursor()
click.setCursorOff()
function onTick()
Text.print(click.sqrFind("example"),0,0)
if click.sqr(click.click,0,0,800,32,"example") then
player.speedY = -5
end
if click.click then
click.setCursorOn()
click.setCursorOff(15)
end
end
- Example 6
Code: Select all
local click = API.load("click")
click.setCursor()
function onTick()
if math.abs(click.speedX) > 50 or math.abs(click.speedY) > 50 then
Defines.earthquake = 5
end
end
- NOTE
- In SMBX, for some reason, it has trouble identifying fast double clicks. I am not sure why but this is SMBX's fault. You can test this in the episode select menu, and see the same result.
Documentation: http://wohlsoft.ru/pgewiki/Click.lua
If you see any errors, please tell me as soon as possible so I can fix them.