提交 799b7447 编写于 作者: baidwwy's avatar baidwwy 🏋

圆形小地图

上级 faba17f8
{
"recommendations": [
"CodeInChinese.ChineseInputAssistant",
"aaron-bond.better-comments",
"coenraads.bracket-pair-colorizer-2",
"ms-ceintl.vscode-language-pack-zh-hans",
"asuka.insertnumbers",
"obkoro1.korofileheader",
"tomblind.local-lua-debugger-vscode",
"sumneko.lua",
"autsing.lua-format-extension",
"vscode-icons-team.vscode-icons",
]
}
\ No newline at end of file
-- @Author : GGELUA
-- @Date : 2021-12-02 20:09:56
-- @Last Modified time : 2022-01-27 08:08:56
-- [./] 表示项目目录
local tt = os.clock()
print('编译文件')
编译目录('ggelua')
编译目录('./lua')
if arg[1] == 'windows' then
print('复制文件')
复制文件('SDL2.dll', './build/SDL2.dll')
复制文件('SDL_image.dll', './build/SDL_image.dll')
复制文件('SDL_mixer.dll', './build/SDL_mixer.dll')
复制文件('SDL_ttf.dll', './build/SDL_ttf.dll')
复制文件('lua54.dll', './build/lua54.dll')
复制文件('ggelua.dll', './build/ggelua.dll')
复制文件('lib/gsdl2.dll', './build/lib/gsdl2.dll')
联接目录('./assets', './build/assets')
写出Windows('./build/GGELUA.exe')
elseif arg[1] == 'android' then
--由于assets不支持中文,资源名转换
-- print('处理文件')
-- for path,rel in 遍历目录('./data') do
-- local hash = gge.hash(path:sub(#rel+6))
-- print(string.format('assets/%08x', hash), path)
-- 复制文件(path, string.format('./assets/%08x', hash), false)
-- end
写出Android('mygame', '我的游戏', '.vscode/ico.png')
end
print('编译完成\n用时:' .. os.clock() - tt .. '秒')
{
// Place your client 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"GGE类_初始化": {
"scope": "lua",
"prefix": "class",
"description": "GGE类",
"body": ["local ${1:$TM_FILENAME_BASE} = class('${1}')",
"",
"function ${1}:初始化(${2})",
"${3}",
"end",
"",
"function ${1}:更新(dt)",
"",
"end",
"",
"function ${1}:显示(x,y)",
"",
"end",
"",
"return ${1}"]
},
"GGE类_方法": {
"scope": "lua",
"prefix": "classfunction",
"description": "GGE类方法",
"body": [
"function ${1:$TM_FILENAME_BASE}:${2:名称}(${3})",
"${4}",
"end",
]
},
"GGE类_类名": {
"scope": "lua",
"prefix": "class",
"description": "GGE类",
"body": ["local ${1:$TM_FILENAME_BASE} = class('${1}')",
"",
"function ${1}:${1}(${2})",
"${3}",
"end",
"",
"function ${1}:更新(dt)",
"",
"end",
"",
"function ${1}:显示(x,y)",
"",
"end",
"",
"return ${1}"]
}
}
\ No newline at end of file
-- @Author : GGELUA
-- @Date : 2022-01-17 02:57:37
-- @Last Modified by : baidwwy
-- @Last Modified time : 2022-01-22 14:19:27
print('ggerun',arg[1])
if arg[1]=='android' then
编译目录('ggelua')
编译目录('./lua')
-- for path,rel in 遍历目录('./data') do
-- local hash = gge.hash(path:sub(#rel+6))
-- if 复制文件(path, string.format('./assets/%08x', hash), false) then
-- print(string.format('assets/%08x', hash), path)
-- end
-- end
写出脚本('./assets/ggelua')
else
end
\ No newline at end of file
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug GGELUA",
"type": "lua-local",
"request": "launch",
"program": {
"command": "%GGELUA%/ggelua.exe"
},
"args": [
"${fileWorkspaceFolder}"
],
"cwd": "${fileWorkspaceFolder}",
//"breakInCoroutines": true
}
]
}
\ No newline at end of file
{
"Lua.diagnostics.disable": [
"lowercase-global",
"unused-local",
"undefined-global",
"undefined-env-child",
"unbalanced-assignments",
"trailing-space"
],
"Lua.runtime.unicodeName": true,
}
\ No newline at end of file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
//ggebuild windows
{
"label": "ggebuild_windows",
"type": "shell",
"command": "%GGELUA%/build/windows/build.bat",
"args": [
"${workspaceFolder}"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "lua",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "([^\"]+)\"\\]:(\\d+):\\s*(.*)",
"file": 1,
"line": 2,
"message": 3
}
}
},
//ggebuild android
{
"label": "ggebuild_android",
"type": "shell",
"command": "%GGELUA%/build/android/build.bat",
"args": [
"${workspaceFolder}"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": {
"owner": "lua",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "([^\"]+)\"\\]:(\\d+):\\s*(.*)",
"file": 1,
"line": 2,
"message": 3
}
}
},
//ggerun
{
"label": "ggerun",
"type": "shell",
"command": "%GGELUA%/build/windows/run.bat",
"args": [
"${workspaceFolder}"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"group": "ggelua"
},
"problemMatcher": {
"owner": "lua",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "([^\"]+)\"\\]:(\\d+):\\s*(.*)",
"file": 1,
"line": 2,
"message": 3
}
}
},
{
"label": "ggerun_android",
"type": "shell",
"command": "%GGELUA%/build/android/run.bat",
"args": [
"${workspaceFolder}"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"group": "ggelua"
},
"problemMatcher": {
"owner": "lua",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "([^\"]+)\"\\]:(\\d+):\\s*(.*)",
"file": 1,
"line": 2,
"message": 3
}
}
},
//lua
{
"label": "lua",
"type": "shell",
"command": "%GGELUA%/lua.exe",
"args": [
"${file}",
"${workspaceFolder}"
],
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/c \"\" ",
"chcp 65001 &&"
]
}
}
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": {
"owner": "lua",
"fileLocation": [
"autoDetect",
"${workspaceFolder}"
],
"pattern": {
"regexp": "([^\"]+)\"\\]:(\\d+):\\s*(.*)",
"file": 1,
"line": 2,
"message": 3
}
}
}
]
}
\ No newline at end of file
-- @Author : GGELUA
-- @Date : 2021-04-08 08:00:20
-- @Last Modified by : GGELUA
-- @Last Modified time : 2022-04-27 02:32:36
-- 声明:例子仅供学习交流
local GGEF = require('GGE.函数')
local SDL = require('SDL')
引擎 =
require 'SDL.窗口' {
标题 = '圆形地图框',
宽度 = 800,
高度 = 600,
帧率 = 30,
}
function 引擎:初始化()
渲染区 = require('SDL.纹理')(111, 111)
渲染精灵 = 渲染区:到精灵()
小地图 = require('SDL.精灵')('assets/镇魔谷.jpg')
if 1 == 2 then --两种方式
精灵 = require('SDL.精灵')('assets/B.png')
抠图 = SDL.ComposeCustomBlendMode(1, 2, 1, 2, 1, 1)
精灵:置混合(抠图)
else
精灵 = require('SDL.精灵')('assets/A.png')
抠图 = SDL.ComposeCustomBlendMode(1, 2, 3, 2, 2, 3)
精灵:置混合(抠图)
end
print(抠图)
end
function 引擎:更新事件(dt, x, y)
if 渲染区:渲染开始() then
小地图:显示(0, 0)
精灵:显示(0, 0)
渲染区:渲染结束()
end
end
function 引擎:渲染事件(dt, x, y)
if self:渲染开始(0x70, 0x70, 0x70) then
渲染精灵:显示(50, 50)
self:渲染结束()
end
end
function 引擎:窗口事件(ev)
if ev == SDL.WINDOWEVENT_CLOSE then
引擎:关闭()
end
end
function 引擎:键盘事件(KEY, KMOD, 状态, 按住)
if not 状态 then --弹起
if KEY == SDL.KEY_F1 then
print('F1')
end
end
if KMOD & SDL.KMOD_LCTRL ~= 0 then
print('左CTRL', 按住)
end
if KMOD & SDL.KMOD_ALT ~= 0 then
print('左右ALT', 按住)
end
end
function 引擎:鼠标事件(key, x, y, btn, ...)
end
function 引擎:输入事件()
end
function 引擎:销毁事件()
end
{
"folders": [
{
"path": "."
},
{
"path": "X:\\GGELUA\\GGELUA2\\ggelua"
}
],
"settings": {
"fileheader.customMade": {
"Author": "GGELUA", //作者名称
"Date": "Do not edit", // 设置后默认设置文件生成时间
"LastEditors": "GGELUA",
"LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间
},
"fileheader.configObj": {
"specialOptions": {
"LastEditTime": "Last Modified time",
"LastEditors": "Last Modified by",
},
}
},
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册