代码拉取完成,页面将自动刷新
同步操作将从 gite-hub/ggesoeasy 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
__easy.commonpath = __easy.exepath .. 'bind/'
-- __easy.scriptpath = __easy.scriptpath .. 'script/'
-- print = printAsc
local 窗体宽, 窗体高, FPS = 640, 480, 60
if not gge_createEngine(窗体宽, 窗体高, FPS) then os.exit() end
local KEY = require('key')
local GGE = require('gge')
local 文字类 = require('font')
local 精灵类 = require('sprite')
local 测试文字 = 文字类()
测试文字:设坐标(10, 10)
local 辣稽精灵 = 精灵类('res/lj.png')
辣稽精灵:设坐标(窗体宽 / 2, 窗体高 / 2)
辣稽精灵:设锚点居中()
local function 改变精灵和文字(精灵, 文字)
local x = GGE:随机数(100, 窗体宽 - 100)
local y = GGE:随机数(100, 窗体高 - 100)
精灵:设坐标(x, y)
-- 0.62 ~ 1.5
精灵:设缩放(GGE:随机数(62, 150) / 100)
local r = GGE:随机数(0, 0xFF)
local g = GGE:随机数(0, 0xFF)
local b = GGE:随机数(0, 0xFF)
local 颜色 = GGE:颜色RGB(r, g, b)
文字:设颜色(颜色)
GGE:播放音效('res/闪现.wav')
end
print '按下空格试试'
function mainLoop(dt, x, y)
测试文字:设文字('帧率:' .. dt .. '\n鼠标:' .. string.format('%d %d', x, y))
if GGE:键盘按下(KEY.SPACE) then
改变精灵和文字(辣稽精灵, 测试文字)
elseif GGE:左键按下() then
print("左键按下")
elseif GGE:右键按下() then
print("右键按下")
else
local str = GGE:取字符串()
if str ~= string.empty then
print(str)
end
end
GGE:渲染开始()
测试文字:渲染()
辣稽精灵:渲染()
GGE:渲染结束()
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。