summaryrefslogtreecommitdiff
path: root/Data/BuiltIn
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-20 20:29:08 +0800
committerchai <chaifix@163.com>2021-11-20 20:29:08 +0800
commit0944b2f95b9971d62f35b9dcc38d28a27e278249 (patch)
tree3cd71eff172b394655bf69bf23ec3eb6eb471256 /Data/BuiltIn
parentbb452bba78dc1870d6316b383180472fe3a8a06a (diff)
* mv gui to editor
Diffstat (limited to 'Data/BuiltIn')
-rw-r--r--Data/BuiltIn/Libraries/GameLab/Engine/GUI/GUIState.lua23
-rw-r--r--Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua114
-rw-r--r--Data/BuiltIn/Libraries/GameLab/Engine/GUI/init.lua3
3 files changed, 0 insertions, 140 deletions
diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/GUIState.lua b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/GUIState.lua
deleted file mode 100644
index bb4884e..0000000
--- a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/GUIState.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-local GUIState = GameLab.GlobalStaticClass("GameLab.Engine.GUI.GUIState")
-
-local hotControl = 0
-local currentId = 0 -- 当前可分配的controlID
-
-GUIState.get_hotControl = function()
- return hotControl
-end
-
-GUIState.set_hotControl = function(value)
- hotControl = value
-end
-
-GUIState.GetControlID = function()
- currentId = currentId + 1
- return currentId
-end
-
-GUIState.ResetControlID = function()
- currentId = 0
-end
-
-return GUIState \ No newline at end of file
diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua
deleted file mode 100644
index 3c99622..0000000
--- a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua
+++ /dev/null
@@ -1,114 +0,0 @@
-local GUI = GameLab.Package("GameLab.Engine.GUI")
-
-local find = GameLab.Find
-
-local EditorGUI = GameLab.Editor.GUI
-
-local Debug = GameLab.Debug
-local GUIState = GUI.GUIState
-local Event = GameLab.Events.Event
-local GL = GameLab.Engine.GL
-local Matrix44 = find "GameLab.Engine.Math.Matrix44"
-local Rendering = GameLab.Engine.Rendering
-local EEventType = GameLab.Events.EEventType
-local Resource = GameLab.Engine.Resource
-local Vector2 = GameLab.Engine.Math.Vector2
-local Vector4 = GameLab.Engine.Math.Vector4
-local Color = Rendering.Color
-local builtin_res = require "GameLab.BuiltInResources"
-
-local editor_res
-if GAMELAB_EDITOR then
- editor_res = find "Scripts/EditorResources"
-elseif GAMELAB_RUNNER then
-end
-
-GUI.BeginOnGUI = function()
- GUIState.ResetControlID()
-end
-
-GUI.EndOnGUI = function()
- GUIState.ResetControlID()
-end
-
-GUI.BeginFrame = function()
- GUIState.ResetControlID()
-end
-
-GUI.EndFrame = function()
- GUIState.ResetControlID()
-end
-
-------------------------------------------------------------------------------------------------
--- Controls
-------------------------------------------------------------------------------------------------
-
-GUI.Button = function(rect, content )
-
-end
-
-GUI.Toggle = function()
-
-end
-
-GUI.Label = function()
-
-end
-
-GUI.Box = function(rect, color)
- if Event.current.type == EEventType.Repaint then
- Rendering.UseShader(editor_res.shaders["EditorShape"])
- Rendering.SetVector2("gamelab_ui_position", rect.position)
- Rendering.SetColor("gamelab_color", color)
- GUI.DrawQuad(Vector2(0,0), rect.size)
- end
-end
-
-GUI.BoxFrame = function(rect, color)
- if Event.current.type == EEventType.Repaint then
- GUI.Line(Vector2(rect.x, rect.y), Vector2(rect.x + rect.w, rect.y), color)
- GUI.Line(Vector2(rect.x + rect.w, rect.y), Vector2(rect.x + rect.w, rect.y + rect.h), color)
- GUI.Line(Vector2(rect.x + rect.w, rect.y + rect.h), Vector2(rect.x, rect.y + rect.h), color)
- GUI.Line(Vector2(rect.x, rect.y + rect.h), Vector2(rect.x, rect.y), color)
- end
-end
-
-GUI.HorizontalSlider = function()
-
-end
-
-GUI.VerticalSlider = function()
-
-end
-
-GUI.TextField = function()
-
-end
-
-GUI.TextArea = function()
-
-end
-
-GUI.Toolbar = function()
-
-end
-
-GUI.VerticalScrollbar = function()
-
-end
-
-GUI.HorizontalScrollbar = function()
-
-end
-
-GUI.Line = function(from, to, color)
- if Event.current.type ~= EEventType.Repaint then
- return
- end
- Rendering.UseShader(editor_res.shaders["EditorShape"])
- Rendering.SetVector2("gamelab_ui_position", {0, 0})
- Rendering.SetColor("gamelab_color", color)
- GUI.DrawLine(from, to)
-end
-
-return GUI \ No newline at end of file
diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/init.lua b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/init.lua
index 3012551..2eb8ac2 100644
--- a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/init.lua
+++ b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/init.lua
@@ -1,7 +1,4 @@
local GUI = GameLab.Package("GameLab.Engine.GUI")
local import = GameLab.Import(...)
-import "GUIState"
-import "imgui"
-
return GUI \ No newline at end of file