Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
GGELUA
GGELUA2
提交
bf0af684
GGELUA2
项目概览
GGELUA
/
GGELUA2
通知
169
Star
23
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
代码片段
项目成员
Pages
GGELUA2
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bf0af684
编写于
4月 27, 2022
作者:
baidwwy
🏋
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
异形窗口
上级
cb8104cc
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
462 addition
and
0 deletion
+462
-0
examples/01-基础/11-异形窗口/.vscode/extensions.json
examples/01-基础/11-异形窗口/.vscode/extensions.json
+15
-0
examples/01-基础/11-异形窗口/.vscode/ggebuild.lua
examples/01-基础/11-异形窗口/.vscode/ggebuild.lua
+33
-0
examples/01-基础/11-异形窗口/.vscode/ggelua.code-snippets
examples/01-基础/11-异形窗口/.vscode/ggelua.code-snippets
+73
-0
examples/01-基础/11-异形窗口/.vscode/ggerun.lua
examples/01-基础/11-异形窗口/.vscode/ggerun.lua
+20
-0
examples/01-基础/11-异形窗口/.vscode/icon.png
examples/01-基础/11-异形窗口/.vscode/icon.png
+0
-0
examples/01-基础/11-异形窗口/.vscode/launch.json
examples/01-基础/11-异形窗口/.vscode/launch.json
+22
-0
examples/01-基础/11-异形窗口/.vscode/settings.json
examples/01-基础/11-异形窗口/.vscode/settings.json
+12
-0
examples/01-基础/11-异形窗口/.vscode/tasks.json
examples/01-基础/11-异形窗口/.vscode/tasks.json
+175
-0
examples/01-基础/11-异形窗口/assets/uin2.bmp
examples/01-基础/11-异形窗口/assets/uin2.bmp
+0
-0
examples/01-基础/11-异形窗口/assets/uin2.png
examples/01-基础/11-异形窗口/assets/uin2.png
+0
-0
examples/01-基础/11-异形窗口/ggelua.code-workspace
examples/01-基础/11-异形窗口/ggelua.code-workspace
+42
-0
examples/01-基础/11-异形窗口/lua/main.lua
examples/01-基础/11-异形窗口/lua/main.lua
+70
-0
未找到文件。
examples/01-基础/11-异形窗口/.vscode/extensions.json
0 → 100644
浏览文件 @
bf0af684
{
"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
examples/01-基础/11-异形窗口/.vscode/ggebuild.lua
0 → 100644
浏览文件 @
bf0af684
-- @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
..
'秒'
)
examples/01-基础/11-异形窗口/.vscode/ggelua.code-snippets
0 → 100644
浏览文件 @
bf0af684
{
// 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
examples/01-基础/11-异形窗口/.vscode/ggerun.lua
0 → 100644
浏览文件 @
bf0af684
-- @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
examples/01-基础/11-异形窗口/.vscode/icon.png
0 → 100644
浏览文件 @
bf0af684
19.9 KB
examples/01-基础/11-异形窗口/.vscode/launch.json
0 → 100644
浏览文件 @
bf0af684
{
//
使用
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
examples/01-基础/11-异形窗口/.vscode/settings.json
0 → 100644
浏览文件 @
bf0af684
{
"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
examples/01-基础/11-异形窗口/.vscode/tasks.json
0 → 100644
浏览文件 @
bf0af684
{
//
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
examples/01-基础/11-异形窗口/assets/uin2.bmp
0 → 100644
浏览文件 @
bf0af684
293.5 KB
examples/01-基础/11-异形窗口/assets/uin2.png
0 → 100644
浏览文件 @
bf0af684
141.4 KB
examples/01-基础/11-异形窗口/ggelua.code-workspace
0 → 100644
浏览文件 @
bf0af684
{
"folders": [
{
"path": "."
},
{
"path": "../../../GGELUA",
"name": "GGELUA"
}
],
"settings": {
"fileheader.customMade": {
"Author": "GGELUA", //作者名称
"LastEditors": "baidwwy",
"Date": "Do not edit", // 设置后默认设置文件生成时间
"LastEditTime": "Do not edit", // 设置后,保存文件更改默认更新最后编辑时间
},
"fileheader.configObj": {
"createFileTime": true,
"language": {
"lua": {
"middle": "-- @",
}
},
"customHasHeadEnd": {
"lua": "cancel head and function",
},
"supportAutoLanguage": [
"lua"
],
"specialOptions": {
"特殊字段": "自定义比如LastEditTime/LastEditors",
"LastEditTime": "Last Modified time",
"LastEditors": "Last Modified by",
},
"wideSame": true,
"wideNum": 20,
},
"terminal.integrated.defaultProfile.windows": "Command Prompt"
},
}
\ No newline at end of file
examples/01-基础/11-异形窗口/lua/main.lua
0 → 100644
浏览文件 @
bf0af684
-- @Author : GGELUA
-- @Last Modified by : baidwwy
-- @Date : 2022-03-23 10:09:27
-- @Last Modified time : 2022-04-27 01:30:45
local
SDL
=
require
(
'SDL'
)
引擎
=
require
'SDL.窗口'
{
标题
=
'GGELUA_异形窗口'
,
宽度
=
800
,
高度
=
600
,
帧率
=
60
,
渲染器
=
'software'
,
异形
=
true
}
function
引擎:初始化
()
local
sf
=
require
(
'SDL.图像'
)(
'assets/uin2.png'
)
--sf:置透明色(255, 0, 255)
print
(
self
:
置图像
(
sf
))
spr
=
require
(
'SDL.精灵'
)(
'assets/uin2.png'
)
end
function
引擎:更新事件
(
dt
,
x
,
y
)
end
function
引擎:渲染事件
(
dt
,
x
,
y
)
if
self
:
渲染开始
(
0x70
,
0x70
,
0x70
)
then
spr
:
显示
(
0
,
0
)
self
:
渲染结束
()
end
end
function
引擎:窗口事件
(
ev
)
if
ev
==
SDL
.
WINDOWEVENT_CLOSE
then
引擎
:
关闭
()
end
end
function
引擎:键盘事件
(
KEY
,
KMOD
,
状态
,
按住
)
if
not
状态
then
--弹起
if
KEY
==
SDL
.
KEY_ESCAPE
then
引擎
:
关闭
()
end
end
if
KMOD
&
SDL
.
KMOD_LCTRL
~=
0
then
print
(
'左CTRL'
,
按住
)
end
if
KMOD
&
SDL
.
KMOD_ALT
~=
0
then
print
(
'左右ALT'
,
按住
)
end
end
function
引擎:鼠标事件
(
消息
,
x
,
y
,
key
)
if
消息
==
SDL
.
MOUSE_DOWN
then
self
.
按下偏移
=
require
(
'GGE.坐标'
)(
x
,
y
)
local
_
,
gx
,
gy
=
SDL
.
GetGlobalMouseState
()
self
.
按下位置
=
require
(
'GGE.坐标'
)(
gx
,
gy
)
elseif
消息
==
SDL
.
MOUSE_MOTION
and
key
&
SDL
.
BUTTON_LEFT
==
SDL
.
BUTTON_LEFT
then
local
_
,
gx
,
gy
=
SDL
.
GetGlobalMouseState
()
self
:
置坐标
(
require
(
'GGE.坐标'
)(
gx
,
gy
)
-
self
.
按下偏移
)
end
end
function
引擎:输入事件
()
end
function
引擎:销毁事件
()
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录