鍵盤事件捕獲

function love.load()
text = ""
drawCircle = false
downFont = false
x = 400
y = 200


--world = love.physics.newWorld(0,200,true)




end








function love.update(dt)


if downFont ==true then
y = y-5
downFont = false
end


end






function love.draw()


love.graphics.print(text,x,y)
if drawCircle ==true then
--love.graphics.setColor(255,0,0)
love.graphics.circle("line",300,200,20)
end


end


function love.keypressed(key,unicode)


if key =="return" then
text = "key:return pressed"
drawCircle = true
elseif key =="down" then
text = "arrow down key is pressed"
downFont = true
end


end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章