mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 16:09:06 +07:00
remove script system and bindings
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
{
|
||||
"prefab" : "../prefabs/scene_prefab.json",
|
||||
"components" : {
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_07/sample_07.lua"
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prefab" : "../prefabs/camera_prefab.json"
|
||||
},{
|
||||
@@ -15,9 +10,6 @@
|
||||
"actor" : {
|
||||
"translation" : [0,0],
|
||||
"scale" : 20
|
||||
},
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_07/gnome.lua"
|
||||
}
|
||||
}
|
||||
},{
|
||||
@@ -32,9 +24,6 @@
|
||||
"actor" : {
|
||||
"translation" : [-502,-246],
|
||||
"scale" : 1
|
||||
},
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_07/fps_label.lua"
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
{
|
||||
"prefab" : "../prefabs/scene_prefab.json",
|
||||
"components" : {
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_08/sample_08.lua"
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prefab" : "../prefabs/camera_prefab.json",
|
||||
"components" : {
|
||||
@@ -41,9 +36,6 @@
|
||||
"translation" : [0,0],
|
||||
"rotation" : 1
|
||||
},
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_08/ship.lua"
|
||||
},
|
||||
"touchable" : {},
|
||||
"circle_collider" : {
|
||||
"offset" : [10,15],
|
||||
@@ -61,9 +53,6 @@
|
||||
"rotation" : 1,
|
||||
"scale" : [0.5,0.5]
|
||||
},
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_08/ship.lua"
|
||||
},
|
||||
"touchable" : {},
|
||||
"circle_collider" : {
|
||||
"offset" : [10,15],
|
||||
@@ -81,9 +70,6 @@
|
||||
"translation" : [120,100],
|
||||
"rotation" : 0.2
|
||||
},
|
||||
"behaviour" : {
|
||||
"script" : "../scripts/sample_08/ship.lua"
|
||||
},
|
||||
"touchable" : {},
|
||||
"rect_collider" : {
|
||||
"size" : [66,113]
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class atlas
|
||||
local atlas = {
|
||||
}
|
||||
|
||||
---@type atlas
|
||||
_G.atlas = _G.atlas or atlas
|
||||
|
||||
---@class atlas_asset
|
||||
local atlas_asset = {
|
||||
---@type atlas
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type atlas_asset
|
||||
_G.atlas_asset = _G.atlas_asset or atlas_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class binary
|
||||
local binary = {
|
||||
}
|
||||
|
||||
---@type binary
|
||||
_G.binary = _G.binary or binary
|
||||
|
||||
---@class binary_asset
|
||||
local binary_asset = {
|
||||
---@type binary
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type binary_asset
|
||||
_G.binary_asset = _G.binary_asset or binary_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class flipbook
|
||||
local flipbook = {
|
||||
}
|
||||
|
||||
---@type flipbook
|
||||
_G.flipbook = _G.flipbook or flipbook
|
||||
|
||||
---@class flipbook_asset
|
||||
local flipbook_asset = {
|
||||
---@type flipbook
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type flipbook_asset
|
||||
_G.flipbook_asset = _G.flipbook_asset or flipbook_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class font
|
||||
local font = {
|
||||
}
|
||||
|
||||
---@type font
|
||||
_G.font = _G.font or font
|
||||
|
||||
---@class font_asset
|
||||
local font_asset = {
|
||||
---@type font
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type font_asset
|
||||
_G.font_asset = _G.font_asset or font_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class image
|
||||
local image = {
|
||||
}
|
||||
|
||||
---@type image
|
||||
_G.image = _G.image or image
|
||||
|
||||
---@class image_asset
|
||||
local image_asset = {
|
||||
---@type image
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type image_asset
|
||||
_G.image_asset = _G.image_asset or image_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class json
|
||||
local json = {
|
||||
}
|
||||
|
||||
---@type json
|
||||
_G.json = _G.json or json
|
||||
|
||||
---@class json_asset
|
||||
local json_asset = {
|
||||
---@type json
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type json_asset
|
||||
_G.json_asset = _G.json_asset or json_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class material
|
||||
local material = {
|
||||
}
|
||||
|
||||
---@type material
|
||||
_G.material = _G.material or material
|
||||
|
||||
---@class material_asset
|
||||
local material_asset = {
|
||||
---@type material
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type material_asset
|
||||
_G.material_asset = _G.material_asset or material_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class mesh
|
||||
local mesh = {
|
||||
}
|
||||
|
||||
---@type mesh
|
||||
_G.mesh = _G.mesh or mesh
|
||||
|
||||
---@class mesh_asset
|
||||
local mesh_asset = {
|
||||
---@type mesh
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type mesh_asset
|
||||
_G.mesh_asset = _G.mesh_asset or mesh_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class model
|
||||
local model = {
|
||||
}
|
||||
|
||||
---@type model
|
||||
_G.model = _G.model or model
|
||||
|
||||
---@class model_asset
|
||||
local model_asset = {
|
||||
---@type model
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type model_asset
|
||||
_G.model_asset = _G.model_asset or model_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class prefab
|
||||
local prefab = {
|
||||
}
|
||||
|
||||
---@type prefab
|
||||
_G.prefab = _G.prefab or prefab
|
||||
|
||||
---@class prefab_asset
|
||||
local prefab_asset = {
|
||||
---@type prefab
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type prefab_asset
|
||||
_G.prefab_asset = _G.prefab_asset or prefab_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class script
|
||||
local script = {
|
||||
}
|
||||
|
||||
---@type script
|
||||
_G.script = _G.script or script
|
||||
|
||||
---@class script_asset
|
||||
local script_asset = {
|
||||
---@type script
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type script_asset
|
||||
_G.script_asset = _G.script_asset or script_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class shader
|
||||
local shader = {
|
||||
}
|
||||
|
||||
---@type shader
|
||||
_G.shader = _G.shader or shader
|
||||
|
||||
---@class shader_asset
|
||||
local shader_asset = {
|
||||
---@type shader
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type shader_asset
|
||||
_G.shader_asset = _G.shader_asset or shader_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class shape
|
||||
local shape = {
|
||||
}
|
||||
|
||||
---@type shape
|
||||
_G.shape = _G.shape or shape
|
||||
|
||||
---@class shape_asset
|
||||
local shape_asset = {
|
||||
---@type shape
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type shape_asset
|
||||
_G.shape_asset = _G.shape_asset or shape_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class sound
|
||||
local sound = {
|
||||
}
|
||||
|
||||
---@type sound
|
||||
_G.sound = _G.sound or sound
|
||||
|
||||
---@class sound_asset
|
||||
local sound_asset = {
|
||||
---@type sound
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type sound_asset
|
||||
_G.sound_asset = _G.sound_asset or sound_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class spine
|
||||
local spine = {
|
||||
}
|
||||
|
||||
---@type spine
|
||||
_G.spine = _G.spine or spine
|
||||
|
||||
---@class spine_asset
|
||||
local spine_asset = {
|
||||
---@type spine
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type spine_asset
|
||||
_G.spine_asset = _G.spine_asset or spine_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class sprite
|
||||
local sprite = {
|
||||
}
|
||||
|
||||
---@type sprite
|
||||
_G.sprite = _G.sprite or sprite
|
||||
|
||||
---@class sprite_asset
|
||||
local sprite_asset = {
|
||||
---@type sprite
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type sprite_asset
|
||||
_G.sprite_asset = _G.sprite_asset or sprite_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class text
|
||||
local text = {
|
||||
}
|
||||
|
||||
---@type text
|
||||
_G.text = _G.text or text
|
||||
|
||||
---@class text_asset
|
||||
local text_asset = {
|
||||
---@type text
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type text_asset
|
||||
_G.text_asset = _G.text_asset or text_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class texture
|
||||
local texture = {
|
||||
}
|
||||
|
||||
---@type texture
|
||||
_G.texture = _G.texture or texture
|
||||
|
||||
---@class texture_asset
|
||||
local texture_asset = {
|
||||
---@type texture
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type texture_asset
|
||||
_G.texture_asset = _G.texture_asset or texture_asset
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class xml
|
||||
local xml = {
|
||||
}
|
||||
|
||||
---@type xml
|
||||
_G.xml = _G.xml or xml
|
||||
|
||||
---@class xml_asset
|
||||
local xml_asset = {
|
||||
---@type xml
|
||||
content = nil
|
||||
}
|
||||
|
||||
---@type xml_asset
|
||||
_G.xml_asset = _G.xml_asset or xml_asset
|
||||
@@ -1,8 +0,0 @@
|
||||
---@class actor
|
||||
local actor = {
|
||||
---@type node
|
||||
node = {}
|
||||
}
|
||||
|
||||
---@type actor
|
||||
_G.actor = _G.actor or actor
|
||||
@@ -1,22 +0,0 @@
|
||||
---@class behaviour
|
||||
local behaviour = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type table
|
||||
meta = {}
|
||||
}
|
||||
|
||||
---@overload fun(self: behaviour)
|
||||
---@param self behaviour
|
||||
function behaviour.enable(self) end
|
||||
|
||||
---@overload fun(self: behaviour)
|
||||
---@param self behaviour
|
||||
function behaviour.disable(self) end
|
||||
|
||||
---@type behaviour
|
||||
_G.behaviour = _G.behaviour or behaviour
|
||||
@@ -1,58 +0,0 @@
|
||||
---@class camera
|
||||
local camera = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
input = false,
|
||||
|
||||
---@type boolean
|
||||
gizmos = false,
|
||||
|
||||
---@type integer
|
||||
depth = 0,
|
||||
|
||||
---@type camera_modes
|
||||
mode = camera.modes.flexible,
|
||||
|
||||
---@type number
|
||||
znear = 0.0,
|
||||
|
||||
---@type number
|
||||
zfar = 1000.0,
|
||||
|
||||
---@type m4f
|
||||
view = m4f.identity(),
|
||||
|
||||
---@type rect
|
||||
viewport = rect.zero(),
|
||||
|
||||
---@type m4f
|
||||
projection = m4f.identity(),
|
||||
|
||||
---@type color
|
||||
background = color.white()
|
||||
}
|
||||
|
||||
---@class camera_modes
|
||||
camera.modes = {
|
||||
manual = "manual",
|
||||
stretch = "stretch",
|
||||
flexible = "flexible",
|
||||
fixed_fit = "fixed_fit",
|
||||
fixed_crop = "fixed_crop"
|
||||
}
|
||||
|
||||
---@overload fun(self: camera)
|
||||
---@param self camera
|
||||
function camera.enable(self) end
|
||||
|
||||
---@overload fun(self: camera)
|
||||
---@param self camera
|
||||
function camera.disable(self) end
|
||||
|
||||
---@type camera
|
||||
_G.camera = _G.camera or camera
|
||||
@@ -1,81 +0,0 @@
|
||||
---@class rect_collider
|
||||
local rect_collider = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type v2f
|
||||
size = v2f.unit(),
|
||||
|
||||
---@type v2f
|
||||
offset = v2f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(self: rect_collider)
|
||||
---@param self rect_collider
|
||||
function rect_collider.enable(self) end
|
||||
|
||||
---@overload fun(self: rect_collider)
|
||||
---@param self rect_collider
|
||||
function rect_collider.disable(self) end
|
||||
|
||||
---@type rect_collider
|
||||
_G.rect_collider = _G.rect_collider or rect_collider
|
||||
|
||||
---@class circle_collider
|
||||
local circle_collider = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type number
|
||||
radius = 1.0,
|
||||
|
||||
---@type v2f
|
||||
offset = v2f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(self: circle_collider)
|
||||
---@param self circle_collider
|
||||
function circle_collider.enable(self) end
|
||||
|
||||
---@overload fun(self: circle_collider)
|
||||
---@param self circle_collider
|
||||
function circle_collider.disable(self) end
|
||||
|
||||
---@type circle_collider
|
||||
_G.circle_collider = _G.circle_collider or circle_collider
|
||||
|
||||
---@class polygon_collider
|
||||
local polygon_collider = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type v2f[]
|
||||
points = {
|
||||
v2f.new(-0.5, -0.5),
|
||||
v2f.new( 0.5, -0.5),
|
||||
v2f.new( 0.5, 0.5),
|
||||
v2f.new(-0.5, 0.5)},
|
||||
|
||||
---@type v2f
|
||||
offset = v2f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(self: polygon_collider)
|
||||
---@param self polygon_collider
|
||||
function polygon_collider.enable(self) end
|
||||
|
||||
---@overload fun(self: polygon_collider)
|
||||
---@param self polygon_collider
|
||||
function polygon_collider.disable(self) end
|
||||
|
||||
---@type polygon_collider
|
||||
_G.polygon_collider = _G.polygon_collider or polygon_collider
|
||||
@@ -1,38 +0,0 @@
|
||||
---@class flipbook_player
|
||||
local flipbook_player = {
|
||||
---@type number
|
||||
time = 0,
|
||||
|
||||
---@type number
|
||||
speed = 1,
|
||||
|
||||
---@type boolean
|
||||
looped = false,
|
||||
|
||||
---@type boolean
|
||||
stopped = true,
|
||||
|
||||
---@type boolean
|
||||
playing = false,
|
||||
|
||||
---@type str_hash
|
||||
sequence = str_hash.new(),
|
||||
|
||||
---@type flipbook_asset
|
||||
flipbook = nil
|
||||
}
|
||||
|
||||
---@overload fun(self: flipbook_player, time: number)
|
||||
---@overload fun(self: flipbook_player, sequence: string)
|
||||
---@overload fun(self: flipbook_player, sequence: str_hash)
|
||||
---@param self flipbook_player
|
||||
function flipbook_player.stop(self, ...) end
|
||||
|
||||
---@overload fun(self: flipbook_player, time: number)
|
||||
---@overload fun(self: flipbook_player, sequence: string)
|
||||
---@overload fun(self: flipbook_player, sequence: str_hash)
|
||||
---@param self flipbook_player
|
||||
function flipbook_player.play(self, ...) end
|
||||
|
||||
---@type flipbook_player
|
||||
_G.flipbook_player = _G.flipbook_player or flipbook_player
|
||||
@@ -1,56 +0,0 @@
|
||||
---@class label
|
||||
local label = {
|
||||
---@type boolean
|
||||
dirty = false,
|
||||
|
||||
---@type string
|
||||
text = "",
|
||||
|
||||
---@type font_asset
|
||||
font = nil,
|
||||
|
||||
---@type color32
|
||||
tint = color32.white(),
|
||||
|
||||
---@type label_haligns
|
||||
halign = label.haligns.center,
|
||||
|
||||
---@type label_valigns
|
||||
valign = label.valigns.baseline,
|
||||
|
||||
---@type number
|
||||
leading = 1,
|
||||
|
||||
---@type number
|
||||
tracking = 0,
|
||||
|
||||
---@type number
|
||||
text_width = 0,
|
||||
|
||||
---@type number
|
||||
glyph_dilate = 0,
|
||||
|
||||
---@type number
|
||||
outline_width = 0,
|
||||
|
||||
---@type color32
|
||||
outline_color = color32.white()
|
||||
}
|
||||
|
||||
---@class label_haligns
|
||||
label.haligns = {
|
||||
left = "left",
|
||||
center = "center",
|
||||
right = "right"
|
||||
}
|
||||
|
||||
---@class label_valigns
|
||||
label.valigns = {
|
||||
top = "top",
|
||||
center = "center",
|
||||
bottom = "bottom",
|
||||
baseline = "baseline"
|
||||
}
|
||||
|
||||
---@type label
|
||||
_G.label = _G.label or label
|
||||
@@ -1,80 +0,0 @@
|
||||
---@class layout
|
||||
local layout = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
dirty = false,
|
||||
|
||||
---@type layout_directions
|
||||
direction = layout.directions.ltr,
|
||||
|
||||
---@type layout_align_modes
|
||||
align_items = layout.align_modes.flex_start,
|
||||
|
||||
---@type layout_align_modes
|
||||
align_conten = layout.align_modes.flex_start,
|
||||
|
||||
---@type layout_justify_modes
|
||||
justify_content = layout.justify_modes.flex_start,
|
||||
|
||||
---@type layout_flex_wraps
|
||||
flex_wrap = layout.flex_wraps.no_wrap,
|
||||
|
||||
---@type layout_flex_directions
|
||||
flex_direction = layout.flex_directions.row
|
||||
}
|
||||
|
||||
---@class layout_directions
|
||||
layout.directions = {
|
||||
ltr = "ltr",
|
||||
rtl = "rtl"
|
||||
}
|
||||
|
||||
---@class layout_align_modes
|
||||
layout.align_modes = {
|
||||
flex_start = "flex_start",
|
||||
center = "center",
|
||||
flex_end = "flex_end",
|
||||
space_between = "space_between",
|
||||
space_around = "space_around"
|
||||
}
|
||||
|
||||
---@class layout_justify_modes
|
||||
layout.justify_modes = {
|
||||
flex_start = "flex_start",
|
||||
center = "center",
|
||||
flex_end = "flex_end",
|
||||
space_between = "space_between",
|
||||
space_around = "space_around",
|
||||
space_evenly = "space_evenly"
|
||||
}
|
||||
|
||||
---@class layout_flex_wraps
|
||||
layout.flex_wraps = {
|
||||
no_wrap = "no_wrap",
|
||||
wrap = "wrap",
|
||||
wrap_reversed = "wrap_reversed"
|
||||
}
|
||||
|
||||
---@class layout_flex_directions
|
||||
layout.flex_directions = {
|
||||
row = "row",
|
||||
row_reversed = "row_reversed",
|
||||
column = "column",
|
||||
column_reversed = "column_reversed"
|
||||
}
|
||||
|
||||
---@overload fun(self: layout)
|
||||
---@param self layout
|
||||
function layout.enable(self) end
|
||||
|
||||
---@overload fun(self: layout)
|
||||
---@param self layout
|
||||
function layout.disable(self) end
|
||||
|
||||
---@type layout
|
||||
_G.layout = _G.layout or layout
|
||||
@@ -1,8 +0,0 @@
|
||||
---@class model_renderer
|
||||
local model_renderer = {
|
||||
---@type model_asset
|
||||
model = nil
|
||||
}
|
||||
|
||||
---@type model_renderer
|
||||
_G.model_renderer = _G.model_renderer or model_renderer
|
||||
@@ -1,8 +0,0 @@
|
||||
---@class named
|
||||
local named = {
|
||||
---@type string
|
||||
name = ""
|
||||
}
|
||||
|
||||
---@type named
|
||||
_G.named = _G.named or named
|
||||
@@ -1,31 +0,0 @@
|
||||
---@class renderer
|
||||
local renderer = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type t3f
|
||||
transform = t3f.identity(),
|
||||
|
||||
---@type v3f
|
||||
translation = v3f.zero(),
|
||||
|
||||
---@type v3f
|
||||
rotation = v3f.zero(),
|
||||
|
||||
---@type v3f
|
||||
scale = v3f.unit()
|
||||
}
|
||||
|
||||
---@overload fun(self: renderer)
|
||||
---@param self renderer
|
||||
function renderer.enable(self) end
|
||||
|
||||
---@overload fun(self: renderer)
|
||||
---@param self renderer
|
||||
function renderer.disable(self) end
|
||||
|
||||
---@type renderer
|
||||
_G.renderer = _G.renderer or renderer
|
||||
@@ -1,22 +0,0 @@
|
||||
---@class scene
|
||||
local scene = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type integer
|
||||
depth = 0
|
||||
}
|
||||
|
||||
---@overload fun(self: scene)
|
||||
---@param self scene
|
||||
function scene.enable(self) end
|
||||
|
||||
---@overload fun(self: scene)
|
||||
---@param self scene
|
||||
function scene.disable(self) end
|
||||
|
||||
---@type scene
|
||||
_G.scene = _G.scene or scene
|
||||
@@ -1,229 +0,0 @@
|
||||
---@class spine_player
|
||||
local spine_player = {
|
||||
---@type spine_asset
|
||||
spine = nil
|
||||
}
|
||||
|
||||
---@param self spine_player
|
||||
---@param name string
|
||||
---@return boolean
|
||||
function spine_player.skin(self, name) end
|
||||
|
||||
---@param self spine_player
|
||||
---@param slot string
|
||||
---@param name string
|
||||
---@return boolean
|
||||
function spine_player.attachment(self, slot, name) end
|
||||
|
||||
---@param self spine_player
|
||||
---@param name string
|
||||
---@return boolean
|
||||
function spine_player.has_skin(self, name) end
|
||||
|
||||
---@param self spine_player
|
||||
---@param name string
|
||||
---@return boolean
|
||||
function spine_player.has_animation(self, name) end
|
||||
|
||||
---@param self spine_player
|
||||
---@param cmd spine_player_command
|
||||
function spine_player.add_command(self, cmd) end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- events
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@alias spine_player_event spine_player_custom_evt | spine_player_end_evt | spine_player_complete_evt
|
||||
|
||||
--
|
||||
-- custom_evt
|
||||
--
|
||||
|
||||
---@class spine_player_custom_evt
|
||||
spine_player.custom_evt = {
|
||||
---@type string
|
||||
name = "",
|
||||
|
||||
---@type integer
|
||||
int_value = 0,
|
||||
|
||||
---@type number
|
||||
float_value = 0,
|
||||
|
||||
---@type string
|
||||
string_value = ""
|
||||
}
|
||||
|
||||
---@overload fun(): spine_player_custom_evt
|
||||
---@overload fun(name: string): spine_player_custom_evt
|
||||
---@return spine_player_custom_evt
|
||||
function spine_player.custom_evt.new(...) end
|
||||
|
||||
--
|
||||
-- end_evt
|
||||
--
|
||||
|
||||
---@class spine_player_end_evt
|
||||
spine_player.end_evt = {
|
||||
---@type string
|
||||
message = ""
|
||||
}
|
||||
|
||||
---@overload fun(): spine_player_end_evt
|
||||
---@overload fun(message: string): spine_player_end_evt
|
||||
---@return spine_player_end_evt
|
||||
function spine_player.end_evt.new(...) end
|
||||
|
||||
--
|
||||
-- complete
|
||||
--
|
||||
|
||||
---@class spine_player_complete_evt
|
||||
spine_player.complete_evt = {
|
||||
---@type string
|
||||
message = ""
|
||||
}
|
||||
|
||||
---@overload fun(): spine_player_complete_evt
|
||||
---@overload fun(message: string): spine_player_complete_evt
|
||||
---@return spine_player_complete_evt
|
||||
function spine_player.complete_evt.new(...) end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- commands
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@alias spine_player_command spine_player_clear_track_cmd | spine_player_set_anim_cmd | spine_player_add_anim_cmd | spine_player_set_empty_anim_cmd | spine_player_add_empty_anim_cmd
|
||||
|
||||
--
|
||||
-- clear_track_cmd
|
||||
--
|
||||
|
||||
---@class spine_player_clear_track_cmd
|
||||
spine_player.clear_track_cmd = {
|
||||
---@type integer
|
||||
track = 0
|
||||
}
|
||||
|
||||
---@param track integer
|
||||
---@return spine_player_clear_track_cmd
|
||||
function spine_player.clear_track_cmd.new(track) end
|
||||
|
||||
--
|
||||
-- set_anim_cmd
|
||||
--
|
||||
|
||||
---@class spine_player_set_anim_cmd
|
||||
spine_player.set_anim_cmd = {
|
||||
---@type integer
|
||||
track = 0,
|
||||
|
||||
---@type string
|
||||
name = "",
|
||||
|
||||
---@type boolean
|
||||
loop = false,
|
||||
|
||||
---@type string
|
||||
end_message = "",
|
||||
|
||||
---@type string
|
||||
complete_message = ""
|
||||
}
|
||||
|
||||
---@param track integer
|
||||
---@param name string
|
||||
---@return spine_player_set_anim_cmd
|
||||
function spine_player.set_anim_cmd.new(track, name) end
|
||||
|
||||
--
|
||||
-- add_anim_cmd
|
||||
--
|
||||
|
||||
---@class spine_player_add_anim_cmd
|
||||
spine_player.add_anim_cmd = {
|
||||
---@type integer
|
||||
track = 0,
|
||||
|
||||
---@type string
|
||||
name = "",
|
||||
|
||||
---@type boolean
|
||||
loop = false,
|
||||
|
||||
---@type number
|
||||
delay = 0,
|
||||
|
||||
---@type string
|
||||
end_message = "",
|
||||
|
||||
---@type string
|
||||
complete_message = ""
|
||||
}
|
||||
|
||||
---@param track integer
|
||||
---@param name string
|
||||
---@return spine_player_add_anim_cmd
|
||||
function spine_player.add_anim_cmd.new(track, name) end
|
||||
|
||||
--
|
||||
-- set_empty_anim_cmd
|
||||
--
|
||||
|
||||
---@class spine_player_set_empty_anim_cmd
|
||||
spine_player.set_empty_anim_cmd = {
|
||||
---@type integer
|
||||
track = 0,
|
||||
|
||||
---@type number
|
||||
mix_duration = 0,
|
||||
|
||||
---@type string
|
||||
end_message = "",
|
||||
|
||||
---@type string
|
||||
complete_message = ""
|
||||
}
|
||||
|
||||
---@param track integer
|
||||
---@return spine_player_set_empty_anim_cmd
|
||||
function spine_player.set_empty_anim_cmd.new(track) end
|
||||
|
||||
--
|
||||
-- add_empty_anim_cmd
|
||||
--
|
||||
|
||||
---@class spine_player_add_empty_anim_cmd
|
||||
spine_player.add_empty_anim_cmd = {
|
||||
---@type integer
|
||||
track = 0,
|
||||
|
||||
---@type number
|
||||
delay = 0,
|
||||
|
||||
---@type number
|
||||
mix_duration = 0,
|
||||
|
||||
---@type string
|
||||
end_message = "",
|
||||
|
||||
---@type string
|
||||
complete_message = ""
|
||||
}
|
||||
|
||||
---@param track integer
|
||||
---@return spine_player_add_empty_anim_cmd
|
||||
function spine_player.add_empty_anim_cmd.new(track) end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- globals
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@type spine_player
|
||||
_G.spine_player = _G.spine_player or spine_player
|
||||
@@ -1,37 +0,0 @@
|
||||
---@class sprite_renderer
|
||||
local sprite_renderer = {
|
||||
---@type color32
|
||||
tint = color32.white(),
|
||||
|
||||
---@type v2f
|
||||
scale = v2f.unit(),
|
||||
|
||||
---@type sprite_renderer_modes
|
||||
mode = sprite_renderer.modes.simple,
|
||||
|
||||
---@type sprite_renderer_blendings
|
||||
blending = sprite_renderer.blendings.normal,
|
||||
|
||||
---@type boolean
|
||||
filtering = true,
|
||||
|
||||
---@type sprite_asset
|
||||
sprite = nil
|
||||
}
|
||||
|
||||
---@class sprite_renderer_modes
|
||||
sprite_renderer.modes = {
|
||||
simple = "simple",
|
||||
sliced = "sliced"
|
||||
}
|
||||
|
||||
---@class sprite_renderer_blendings
|
||||
sprite_renderer.blendings = {
|
||||
normal = "normal",
|
||||
additive = "additive",
|
||||
multiply = "multiply",
|
||||
screen = "screen"
|
||||
}
|
||||
|
||||
---@type sprite_renderer
|
||||
_G.sprite_renderer = _G.sprite_renderer or sprite_renderer
|
||||
@@ -1,81 +0,0 @@
|
||||
---@class touchable
|
||||
local touchable = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
bubbling = true,
|
||||
|
||||
---@type boolean
|
||||
capturing = true
|
||||
}
|
||||
|
||||
---@overload fun(self: touchable)
|
||||
---@param self touchable
|
||||
function touchable.enable(self) end
|
||||
|
||||
---@overload fun(self: touchable)
|
||||
---@param self touchable
|
||||
function touchable.disable(self) end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- events
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
--
|
||||
-- input_evt
|
||||
--
|
||||
|
||||
---@class touchable_base_evt
|
||||
touchable.input_evt = {
|
||||
---@type gobject
|
||||
target = nil,
|
||||
|
||||
---@type boolean
|
||||
bubbling = true,
|
||||
|
||||
---@type boolean
|
||||
capturing = true
|
||||
}
|
||||
|
||||
--
|
||||
-- mouse_evt
|
||||
--
|
||||
|
||||
---@class touchable_mouse_evt : touchable_base_evt
|
||||
touchable.mouse_evt = {
|
||||
---@type string
|
||||
type = "pressed",
|
||||
|
||||
---@type string
|
||||
button = "left"
|
||||
}
|
||||
|
||||
--
|
||||
-- touch_evt
|
||||
--
|
||||
|
||||
---@class touchable_touch_evt : touchable_base_evt
|
||||
touchable.touch_evt = {
|
||||
---@type string
|
||||
type = "pressed",
|
||||
|
||||
---@type integer
|
||||
finger = 0
|
||||
}
|
||||
|
||||
---@alias touchable_event touchable_mouse_evt | touchable_touch_evt
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- globals
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@type touchable
|
||||
_G.touchable = _G.touchable or touchable
|
||||
@@ -1,31 +0,0 @@
|
||||
---@class widget
|
||||
local widget = {
|
||||
---@type boolean
|
||||
enabled = true,
|
||||
|
||||
---@type boolean
|
||||
disabled = false,
|
||||
|
||||
---@type boolean
|
||||
dirty = false,
|
||||
|
||||
---@type v2f
|
||||
size = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
margin = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
padding = v2f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(self: widget)
|
||||
---@param self widget
|
||||
function widget.enable(self) end
|
||||
|
||||
---@overload fun(self: widget)
|
||||
---@param self widget
|
||||
function widget.disable(self) end
|
||||
|
||||
---@type widget
|
||||
_G.widget = _G.widget or widget
|
||||
@@ -1,8 +0,0 @@
|
||||
---@class dbgui
|
||||
local dbgui = {
|
||||
---@type boolean
|
||||
visible = false
|
||||
}
|
||||
|
||||
---@type dbgui
|
||||
_G.the_dbgui = _G.the_dbgui or dbgui
|
||||
@@ -1,22 +0,0 @@
|
||||
---@class debug
|
||||
local debug = {
|
||||
}
|
||||
|
||||
---@param self debug
|
||||
---@param message string
|
||||
function debug.trace(self, message) end
|
||||
|
||||
---@param self debug
|
||||
---@param message string
|
||||
function debug.warning(self, message) end
|
||||
|
||||
---@param self debug
|
||||
---@param message string
|
||||
function debug.error(self, message) end
|
||||
|
||||
---@param self debug
|
||||
---@param message string
|
||||
function debug.fatal(self, message) end
|
||||
|
||||
---@type debug
|
||||
_G.the_debug = _G.the_debug or debug
|
||||
@@ -1,20 +0,0 @@
|
||||
---@class engine
|
||||
local engine = {
|
||||
---@type number
|
||||
time = 0,
|
||||
|
||||
---@type number
|
||||
delta_time = 0,
|
||||
|
||||
---@type integer
|
||||
frame_rate = 0,
|
||||
|
||||
---@type integer
|
||||
frame_count = 0,
|
||||
|
||||
---@type number
|
||||
realtime_time = 0
|
||||
}
|
||||
|
||||
---@type engine
|
||||
_G.the_engine = _G.the_engine or engine
|
||||
@@ -1,11 +0,0 @@
|
||||
---@class input
|
||||
local input = {
|
||||
---@type mouse
|
||||
mouse = nil,
|
||||
|
||||
---@type keyboard
|
||||
keyboard = nil
|
||||
}
|
||||
|
||||
---@type input
|
||||
_G.the_input = _G.the_input or input
|
||||
@@ -1,41 +0,0 @@
|
||||
---@class keyboard
|
||||
local keyboard = {
|
||||
---@type string
|
||||
input_text = "",
|
||||
|
||||
---@type boolean
|
||||
is_any_key_pressed = false,
|
||||
|
||||
---@type boolean
|
||||
is_any_key_just_pressed = false,
|
||||
|
||||
---@type boolean
|
||||
is_any_key_just_released = false,
|
||||
|
||||
---@type string[]
|
||||
pressed_keys = {},
|
||||
|
||||
---@type string[]
|
||||
just_pressed_keys = {},
|
||||
|
||||
---@type string[]
|
||||
just_released_keys = {}
|
||||
}
|
||||
|
||||
---@param self keyboard
|
||||
---@param key string
|
||||
---@return boolean
|
||||
function keyboard.is_key_pressed(self, key) end
|
||||
|
||||
---@param self keyboard
|
||||
---@param key string
|
||||
---@return boolean
|
||||
function keyboard.is_key_just_pressed(self, key) end
|
||||
|
||||
---@param self keyboard
|
||||
---@param key string
|
||||
---@return boolean
|
||||
function keyboard.is_key_just_released(self, key) end
|
||||
|
||||
---@type keyboard
|
||||
_G.the_keyboard = _G.the_keyboard or keyboard
|
||||
@@ -1,44 +0,0 @@
|
||||
---@class mouse
|
||||
local mouse = {
|
||||
---@type v2f
|
||||
cursor_pos = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
scroll_delta = v2f.zero(),
|
||||
|
||||
---@type boolean
|
||||
is_any_button_pressed = false,
|
||||
|
||||
---@type boolean
|
||||
is_any_button_just_pressed = false,
|
||||
|
||||
---@type boolean
|
||||
is_any_button_just_released = false,
|
||||
|
||||
---@type string[]
|
||||
pressed_buttons = {},
|
||||
|
||||
---@type string[]
|
||||
just_pressed_buttons = {},
|
||||
|
||||
---@type string[]
|
||||
just_released_buttons = {}
|
||||
}
|
||||
|
||||
---@param self mouse
|
||||
---@param button string
|
||||
---@return boolean
|
||||
function mouse.is_button_pressed(self, button) end
|
||||
|
||||
---@param self mouse
|
||||
---@param button string
|
||||
---@return boolean
|
||||
function mouse.is_button_just_pressed(self, button) end
|
||||
|
||||
---@param self mouse
|
||||
---@param button string
|
||||
---@return boolean
|
||||
function mouse.is_button_just_released(self, button) end
|
||||
|
||||
---@type mouse
|
||||
_G.the_mouse = _G.the_mouse or mouse
|
||||
@@ -1,50 +0,0 @@
|
||||
---@class window
|
||||
local window = {
|
||||
---@type boolean
|
||||
enable = true,
|
||||
|
||||
---@type boolean
|
||||
visible = true,
|
||||
|
||||
---@type boolean
|
||||
focused = true,
|
||||
|
||||
---@type boolean
|
||||
minimized = true,
|
||||
|
||||
---@type boolean
|
||||
fullscreen = false,
|
||||
|
||||
---@type boolean
|
||||
cursor_hidden = false,
|
||||
|
||||
---@type v2f
|
||||
real_size = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
virtual_size = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
framebuffer_size = v2f.zero(),
|
||||
|
||||
---@type string
|
||||
title = "",
|
||||
|
||||
---@type boolean
|
||||
should_close = false
|
||||
}
|
||||
|
||||
---@param self window
|
||||
function window.hide(self) end
|
||||
|
||||
---@param self window
|
||||
function window.show(self) end
|
||||
|
||||
---@param self window
|
||||
function window.restore(self) end
|
||||
|
||||
---@param self window
|
||||
function window.minimize(self) end
|
||||
|
||||
---@type window
|
||||
_G.the_window = _G.the_window or window
|
||||
@@ -1,15 +0,0 @@
|
||||
---@class editor
|
||||
local editor = {
|
||||
---@type gobject
|
||||
selection = nil
|
||||
}
|
||||
|
||||
---@param self editor
|
||||
---@param go gobject
|
||||
function editor.select(self, go) end
|
||||
|
||||
---@param self editor
|
||||
function editor.clear_selection(self) end
|
||||
|
||||
---@type editor
|
||||
_G.the_editor = _G.the_editor or editor
|
||||
@@ -1,65 +0,0 @@
|
||||
---@class gobject
|
||||
local gobject = {
|
||||
---@type boolean
|
||||
alive = true,
|
||||
|
||||
---@type boolean
|
||||
valid = true,
|
||||
|
||||
---@type actor
|
||||
actor = nil,
|
||||
|
||||
---@type behaviour
|
||||
behaviour = nil,
|
||||
|
||||
---@type camera
|
||||
camera = nil,
|
||||
|
||||
---@type rect_collider
|
||||
rect_collider = nil,
|
||||
|
||||
---@type circle_collider
|
||||
circle_collider = nil,
|
||||
|
||||
---@type polygon_collider
|
||||
polygon_collider = nil,
|
||||
|
||||
---@type flipbook_player
|
||||
flipbook_player = nil,
|
||||
|
||||
---@type label
|
||||
label = nil,
|
||||
|
||||
---@type layout
|
||||
layout = nil,
|
||||
|
||||
---@type model_renderer
|
||||
model_renderer = nil,
|
||||
|
||||
---@type named
|
||||
named = nil,
|
||||
|
||||
---@type renderer
|
||||
renderer = nil,
|
||||
|
||||
---@type scene
|
||||
scene = nil,
|
||||
|
||||
---@type spine_player
|
||||
spine_player = nil,
|
||||
|
||||
---@type sprite_renderer
|
||||
sprite_renderer = nil,
|
||||
|
||||
---@type touchable
|
||||
touchable = nil,
|
||||
|
||||
---@type widget
|
||||
widget = nil
|
||||
}
|
||||
|
||||
---@param self gobject
|
||||
function gobject.destroy(self) end
|
||||
|
||||
---@type gobject
|
||||
_G.gobject = _G.gobject or gobject
|
||||
@@ -1,101 +0,0 @@
|
||||
---@class library
|
||||
local library = {
|
||||
}
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return atlas_asset
|
||||
function library.load_atlas(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return binary_asset
|
||||
function library.load_binary(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return flipbook_asset
|
||||
function library.load_flipbook(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return font_asset
|
||||
function library.load_font(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return image_asset
|
||||
function library.load_image(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return json_asset
|
||||
function library.load_json(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return material_asset
|
||||
function library.load_material(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return mesh_asset
|
||||
function library.load_mesh(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return model_asset
|
||||
function library.load_model(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return prefab_asset
|
||||
function library.load_prefab(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return script_asset
|
||||
function library.load_script(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return shader_asset
|
||||
function library.load_shader(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return shape_asset
|
||||
function library.load_shape(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return sound_asset
|
||||
function library.load_sound(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return spine_asset
|
||||
function library.load_spine(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return sprite_asset
|
||||
function library.load_sprite(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return text_asset
|
||||
function library.load_text(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return texture_asset
|
||||
function library.load_texture(self, address) end
|
||||
|
||||
---@param self library
|
||||
---@param address string
|
||||
---@return xml_asset
|
||||
function library.load_xml(self, address) end
|
||||
|
||||
---@type library
|
||||
_G.the_library = _G.the_library or library
|
||||
@@ -1,177 +0,0 @@
|
||||
---@class node
|
||||
local node = {
|
||||
---@type gobject
|
||||
owner = nil,
|
||||
|
||||
---@type t2f
|
||||
transform = t2f.identity(),
|
||||
|
||||
---@type v2f
|
||||
translation = v2f.zero(),
|
||||
|
||||
---@type number
|
||||
rotation = 0,
|
||||
|
||||
---@type v2f
|
||||
scale = v2f.unit(),
|
||||
|
||||
---@type m4f
|
||||
local_matrix = m4f.identity(),
|
||||
|
||||
---@type m4f
|
||||
world_matrix = m4f.identity(),
|
||||
|
||||
---@type node
|
||||
root = nil,
|
||||
|
||||
---@type node
|
||||
parent = nil,
|
||||
|
||||
---@type integer
|
||||
child_count = 0,
|
||||
|
||||
---@type integer
|
||||
child_count_recursive = 0,
|
||||
|
||||
---@type node
|
||||
first_child = nil,
|
||||
|
||||
---@type node
|
||||
last_child = nil,
|
||||
|
||||
---@type node
|
||||
prev_sibling = nil,
|
||||
|
||||
---@type node
|
||||
next_sibling = nil
|
||||
}
|
||||
|
||||
---@param self node
|
||||
---@param point v4f
|
||||
---@return v4f
|
||||
function node.local_to_world(self, point) end
|
||||
|
||||
---@param self node
|
||||
---@param point v4f
|
||||
---@return v4f
|
||||
function node.world_to_local(self, point) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.has_parent(self) end
|
||||
|
||||
---@param self node
|
||||
---@param parent node
|
||||
---@return boolean
|
||||
function node.has_parent_recursive(self, parent) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.has_children(self) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.has_child_recursive(self, child) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.remove_from_parent(self) end
|
||||
|
||||
---@param self node
|
||||
---@return integer
|
||||
function node.remove_all_children(self) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.add_child(self, child) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@param index integer
|
||||
---@return boolean
|
||||
function node.add_child_at(self, child, index) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.add_child_to_back(self, child) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.add_child_to_front(self, child) end
|
||||
|
||||
---@param self node
|
||||
---@param before node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.add_child_before(self, before, child) end
|
||||
|
||||
---@param self node
|
||||
---@param after node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.add_child_after(self, after, child) end
|
||||
|
||||
---@param self node
|
||||
---@param sibling node
|
||||
---@return boolean
|
||||
function node.add_sibling_before(self, sibling) end
|
||||
|
||||
---@param self node
|
||||
---@param sibling node
|
||||
---@return boolean
|
||||
function node.add_sibling_after(self, sibling) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return boolean
|
||||
function node.remove_child(self, child) end
|
||||
|
||||
---@param self node
|
||||
---@param index integer
|
||||
---@return node
|
||||
function node.remove_child_at(self, index) end
|
||||
|
||||
---@param self node
|
||||
---@param child_l node
|
||||
---@param child_r node
|
||||
---@return boolean
|
||||
function node.swap_children(self, child_l, child_r) end
|
||||
|
||||
---@param self node
|
||||
---@param child_l integer
|
||||
---@param child_r integer
|
||||
---@return boolean
|
||||
function node.swap_children_at(self, child_l, child_r) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.send_backward(self) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.bring_to_back(self) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.send_forward(self) end
|
||||
|
||||
---@param self node
|
||||
---@return boolean
|
||||
function node.bring_to_front(self) end
|
||||
|
||||
---@param self node
|
||||
---@param index integer
|
||||
---@return node
|
||||
function node.child_at(self, index) end
|
||||
|
||||
---@param self node
|
||||
---@param child node
|
||||
---@return integer, boolean
|
||||
function node.child_index(self, child) end
|
||||
|
||||
---@type node
|
||||
_G.node = _G.node or node
|
||||
@@ -1,17 +0,0 @@
|
||||
---@class world
|
||||
local world = {
|
||||
}
|
||||
|
||||
---@overload fun(): gobject
|
||||
---@overload fun(transform: t2f): gobject
|
||||
---@overload fun(parent: node): gobject
|
||||
---@overload fun(parent: node, transform: t2f): gobject
|
||||
---@overload fun(prefab: prefab): gobject
|
||||
---@overload fun(prefab: prefab, transform: t2f): gobject
|
||||
---@overload fun(prefab: prefab, parent: node): gobject
|
||||
---@overload fun(prefab: prefab, parent: node, transform: t2f): gobject
|
||||
---@return gobject
|
||||
function world:instantiate(...) end
|
||||
|
||||
---@type world
|
||||
_G.the_world = _G.the_world or world
|
||||
@@ -1,79 +0,0 @@
|
||||
---@class aabb
|
||||
local aabb = {
|
||||
---@type v3f
|
||||
position = v3f.zero(),
|
||||
|
||||
---@type v3f
|
||||
size = v3f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(): aabb
|
||||
---@overload fun(r: aabb): aabb
|
||||
---@overload fun(w: number, h: number, l: number): aabb
|
||||
---@overload fun(x: number, y: number, z: number, w: number, h: number, l: number): aabb
|
||||
---@overload fun(s: v3f): aabb
|
||||
---@overload fun(p: v3f, s: v3f): aabb
|
||||
---@return aabb
|
||||
function aabb.new(...) end
|
||||
|
||||
---@return aabb
|
||||
function aabb.zero() end
|
||||
|
||||
---@return aabb
|
||||
function aabb.unit() end
|
||||
|
||||
---@overload fun(r: aabb): aabb
|
||||
---@overload fun(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): aabb
|
||||
---@overload fun(p1: v3f, p2: v3f): aabb
|
||||
---@param r aabb
|
||||
---@return aabb
|
||||
function aabb.make_minmax(r) end
|
||||
|
||||
---@param l aabb
|
||||
---@param r aabb
|
||||
---@return boolean
|
||||
function aabb.approximately(l, r) end
|
||||
|
||||
---@param r aabb
|
||||
---@return v3f
|
||||
function aabb.minimum(r) end
|
||||
|
||||
---@param r aabb
|
||||
---@return v3f
|
||||
function aabb.maximum(r) end
|
||||
|
||||
---@param r aabb
|
||||
---@return number
|
||||
function aabb.volume(r) end
|
||||
|
||||
---@param r aabb
|
||||
---@return number
|
||||
function aabb.abs_volume(r) end
|
||||
|
||||
---@param l aabb
|
||||
---@param r aabb
|
||||
---@return aabb
|
||||
function aabb.merged(l, r) end
|
||||
|
||||
---@param r aabb
|
||||
---@param p v3f
|
||||
---@return boolean
|
||||
function aabb.inside(r, p) end
|
||||
|
||||
---@param l aabb
|
||||
---@param r aabb
|
||||
---@return boolean
|
||||
function aabb.overlaps(l, r) end
|
||||
|
||||
---@param r aabb
|
||||
---@param p v3f
|
||||
---@return v3f
|
||||
function aabb.normalized_to_point(r, p) end
|
||||
|
||||
---@param r aabb
|
||||
---@param p v3f
|
||||
---@return v3f
|
||||
function aabb.point_to_normalized(r, p) end
|
||||
|
||||
---@type aabb
|
||||
_G.aabb = _G.aabb or aabb
|
||||
@@ -1,41 +0,0 @@
|
||||
---@class m2f
|
||||
local m2f = {
|
||||
---@type v2f[]
|
||||
rows = {}
|
||||
}
|
||||
|
||||
---@overload fun(): m2f
|
||||
---@overload fun(r0: v2f, r1: v2f): m2f
|
||||
---@return m2f
|
||||
function m2f.new(...) end
|
||||
|
||||
---@return m2f
|
||||
function m2f.zero() end
|
||||
|
||||
---@return m2f
|
||||
function m2f.identity() end
|
||||
|
||||
---@overload fun(x: number, y: number): m2f
|
||||
---@overload fun(xy: v2f): m2f
|
||||
---@return m2f
|
||||
function m2f.make_scale(...) end
|
||||
|
||||
---@param a number
|
||||
---@return m2f
|
||||
function m2f.make_rotation(a) end
|
||||
|
||||
---@param l m2f
|
||||
---@param r m2f
|
||||
---@return boolean
|
||||
function m2f.approximately(l, r) end
|
||||
|
||||
---@param m m2f
|
||||
---@return m2f, boolean
|
||||
function m2f.inversed(m) end
|
||||
|
||||
---@param m m2f
|
||||
---@return m2f
|
||||
function m2f.transposed(m) end
|
||||
|
||||
---@type m2f
|
||||
_G.m2f = _G.m2f or m2f
|
||||
@@ -1,46 +0,0 @@
|
||||
---@class m3f
|
||||
local m3f = {
|
||||
---@type v3f[]
|
||||
rows = {}
|
||||
}
|
||||
|
||||
---@overload fun(): m3f
|
||||
---@overload fun(r0: v3f, r1: v3f, r2: v3f): m3f
|
||||
---@return m3f
|
||||
function m3f.new(...) end
|
||||
|
||||
---@return m3f
|
||||
function m3f.zero() end
|
||||
|
||||
---@return m3f
|
||||
function m3f.identity() end
|
||||
|
||||
---@overload fun(x: number, y: number, z: number): m3f
|
||||
---@overload fun(xyz: v4f): m3f
|
||||
---@overload fun(xyz: v3f): m3f
|
||||
---@overload fun(xy: v2f, z: number): m3f
|
||||
---@return m3f
|
||||
function m3f.make_scale(...) end
|
||||
|
||||
---@overload fun(a: number, x: number, y: number, z: number): m3f
|
||||
---@overload fun(a: number, xyz: v3f): m3f
|
||||
---@overload fun(r: number, p: number, y: number): m3f
|
||||
---@overload fun(rpy: v3f): m3f
|
||||
---@return m3f
|
||||
function m3f.make_rotation(...) end
|
||||
|
||||
---@param l m3f
|
||||
---@param r m3f
|
||||
---@return boolean
|
||||
function m3f.approximately(l, r) end
|
||||
|
||||
---@param m m3f
|
||||
---@return m3f, boolean
|
||||
function m3f.inversed(m) end
|
||||
|
||||
---@param m m3f
|
||||
---@return m3f
|
||||
function m3f.transposed(m) end
|
||||
|
||||
---@type m3f
|
||||
_G.m3f = _G.m3f or m3f
|
||||
@@ -1,96 +0,0 @@
|
||||
---@class m4f
|
||||
local m4f = {
|
||||
---@type v4f[]
|
||||
rows = {}
|
||||
}
|
||||
|
||||
---@overload fun(): m4f
|
||||
---@overload fun(r0: v4f, r1: v4f, r2: v4f, r3: v4f): m4f
|
||||
---@return m4f
|
||||
function m4f.new(...) end
|
||||
|
||||
---@return m4f
|
||||
function m4f.zero() end
|
||||
|
||||
---@return m4f
|
||||
function m4f.identity() end
|
||||
|
||||
---@overload fun(x: number, y: number, z: number): m4f
|
||||
---@overload fun(xyz: v3f): m4f
|
||||
---@overload fun(xy: v2f, z: number): m4f
|
||||
---@return m4f
|
||||
function m4f.make_scale(...) end
|
||||
|
||||
---@overload fun(x: number, y: number, z: number): m4f
|
||||
---@overload fun(xyz: v3f): m4f
|
||||
---@overload fun(xy: v2f, z: number): m4f
|
||||
---@return m4f
|
||||
function m4f.make_translation(...) end
|
||||
|
||||
---@overload fun(a: number, x: number, y: number, z: number): m4f
|
||||
---@overload fun(a: number, xyz: v3f): m4f
|
||||
---@overload fun(r: number, p: number, y: number): m3f
|
||||
---@overload fun(rpy: v3f): m3f
|
||||
---@return m4f
|
||||
function m4f.make_rotation(...) end
|
||||
|
||||
---@param t t2f | t3f
|
||||
---@return m4f
|
||||
function m4f.make_trs(t) end
|
||||
|
||||
---@param eye v3f
|
||||
---@param at v3f
|
||||
---@param up v3f
|
||||
---@return m4f
|
||||
function m4f.make_look_at_lh(eye, at, up) end
|
||||
|
||||
---@param eye v3f
|
||||
---@param at v3f
|
||||
---@param up v3f
|
||||
---@return m4f
|
||||
function m4f.make_look_at_rh(eye, at, up) end
|
||||
|
||||
|
||||
---@overload fun(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): m4f
|
||||
---@overload fun(lb: v2f, rt: v2f, znear: number, zfar: number): m4f
|
||||
---@overload fun(size: v2f, znear: number, zfar: number): m4f
|
||||
---@overload fun(width: number, height: number, znear: number, zfar: number): m4f
|
||||
---@return m4f
|
||||
function m4f.make_orthographic_lh() end
|
||||
|
||||
---@overload fun(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): m4f
|
||||
---@overload fun(lb: v2f, rt: v2f, znear: number, zfar: number): m4f
|
||||
---@overload fun(size: v2f, znear: number, zfar: number): m4f
|
||||
---@overload fun(width: number, height: number, znear: number, zfar: number): m4f
|
||||
---@return m4f
|
||||
function m4f.make_orthographic_rh(left, right, bottom, top, znear, zfar) end
|
||||
|
||||
---@param angle number
|
||||
---@param aspect number
|
||||
---@param znear number
|
||||
---@param zfar number
|
||||
---@return m4f
|
||||
function m4f.make_perspective_lh(angle, aspect, znear, zfar) end
|
||||
|
||||
---@param angle number
|
||||
---@param aspect number
|
||||
---@param znear number
|
||||
---@param zfar number
|
||||
---@return m4f
|
||||
function m4f.make_perspective_rh(angle, aspect, znear, zfar) end
|
||||
|
||||
---@param l m4f
|
||||
---@param r m4f
|
||||
---@return boolean
|
||||
function m4f.approximately(l, r) end
|
||||
|
||||
---@param m m4f
|
||||
---@return m4f, boolean
|
||||
function m4f.inversed(m) end
|
||||
|
||||
---@param m m4f
|
||||
---@return m4f
|
||||
function m4f.transposed(m) end
|
||||
|
||||
---@type m4f
|
||||
_G.m4f = _G.m4f or m4f
|
||||
@@ -1,79 +0,0 @@
|
||||
---@class rect
|
||||
local rect = {
|
||||
---@type v2f
|
||||
position = v2f.zero(),
|
||||
|
||||
---@type v2f
|
||||
size = v2f.zero()
|
||||
}
|
||||
|
||||
---@overload fun(): rect
|
||||
---@overload fun(r: rect): rect
|
||||
---@overload fun(w: number, h: number): rect
|
||||
---@overload fun(x: number, y: number, w: number, h: number): rect
|
||||
---@overload fun(s: v2f): rect
|
||||
---@overload fun(p: v2f, s: v2f): rect
|
||||
---@return rect
|
||||
function rect.new(...) end
|
||||
|
||||
---@return rect
|
||||
function rect.zero() end
|
||||
|
||||
---@return rect
|
||||
function rect.unit() end
|
||||
|
||||
---@overload fun(r: rect): rect
|
||||
---@overload fun(x1: number, y1: number, x2: number, y2: number): rect
|
||||
---@overload fun(p1: v2f, p2: v2f): rect
|
||||
---@param r rect
|
||||
---@return rect
|
||||
function rect.make_minmax(r) end
|
||||
|
||||
---@param l rect
|
||||
---@param r rect
|
||||
---@return boolean
|
||||
function rect.approximately(l, r) end
|
||||
|
||||
---@param r rect
|
||||
---@return v2f
|
||||
function rect.minimum(r) end
|
||||
|
||||
---@param r rect
|
||||
---@return v2f
|
||||
function rect.maximum(r) end
|
||||
|
||||
---@param r rect
|
||||
---@return number
|
||||
function rect.area(r) end
|
||||
|
||||
---@param r rect
|
||||
---@return number
|
||||
function rect.abs_area(r) end
|
||||
|
||||
---@param l rect
|
||||
---@param r rect
|
||||
---@return rect
|
||||
function rect.merged(l, r) end
|
||||
|
||||
---@param r rect
|
||||
---@param p v2f
|
||||
---@return boolean
|
||||
function rect.inside(r, p) end
|
||||
|
||||
---@param l rect
|
||||
---@param r rect
|
||||
---@return boolean
|
||||
function rect.overlaps(l, r) end
|
||||
|
||||
---@param r rect
|
||||
---@param p v2f
|
||||
---@return v2f
|
||||
function rect.normalized_to_point(r, p) end
|
||||
|
||||
---@param r rect
|
||||
---@param p v2f
|
||||
---@return v2f
|
||||
function rect.point_to_normalized(r, p) end
|
||||
|
||||
---@type rect
|
||||
_G.rect = _G.rect or rect
|
||||
@@ -1,41 +0,0 @@
|
||||
---@class t2f
|
||||
local t2f = {
|
||||
---@type v2f
|
||||
translation = v2f.zero(),
|
||||
|
||||
---@type number
|
||||
rotation = 0,
|
||||
|
||||
---@type v2f
|
||||
scale = v2f.unit()
|
||||
}
|
||||
|
||||
---@overload fun(): t2f
|
||||
---@return t2f
|
||||
function t2f.new() end
|
||||
|
||||
---@return t2f
|
||||
function t2f.zero() end
|
||||
|
||||
---@return t2f
|
||||
function t2f.identity() end
|
||||
|
||||
---@param t v2f
|
||||
---@return t2f
|
||||
function t2f.make_translation(t) end
|
||||
|
||||
---@param r number
|
||||
---@return t2f
|
||||
function t2f.make_rotation(r) end
|
||||
|
||||
---@param s v2f
|
||||
---@return t2f
|
||||
function t2f.make_scale(s) end
|
||||
|
||||
---@param l t2f
|
||||
---@param r t2f
|
||||
---@return boolean
|
||||
function t2f.approximately(l, r) end
|
||||
|
||||
---@type t2f
|
||||
_G.t2f = _G.t2f or t2f
|
||||
@@ -1,41 +0,0 @@
|
||||
---@class t3f
|
||||
local t3f = {
|
||||
---@type v3f
|
||||
translation = v3f.zero(),
|
||||
|
||||
---@type v3f
|
||||
rotation = v3f.zero(),
|
||||
|
||||
---@type v3f
|
||||
scale = v3f.unit()
|
||||
}
|
||||
|
||||
---@overload fun(): t3f
|
||||
---@return t3f
|
||||
function t3f.new() end
|
||||
|
||||
---@return t3f
|
||||
function t3f.zero() end
|
||||
|
||||
---@return t3f
|
||||
function t3f.identity() end
|
||||
|
||||
---@param t v3f
|
||||
---@return t3f
|
||||
function t3f.make_translation(t) end
|
||||
|
||||
---@param r v3f
|
||||
---@return t3f
|
||||
function t3f.make_rotation(r) end
|
||||
|
||||
---@param s v3f
|
||||
---@return t3f
|
||||
function t3f.make_scale(s) end
|
||||
|
||||
---@param l t3f
|
||||
---@param r t3f
|
||||
---@return boolean
|
||||
function t3f.approximately(l, r) end
|
||||
|
||||
---@type t3f
|
||||
_G.t3f = _G.t3f or t3f
|
||||
@@ -1,109 +0,0 @@
|
||||
---@class v2f
|
||||
local v2f = {
|
||||
---@type number
|
||||
x = 0,
|
||||
|
||||
---@type number
|
||||
y = 0
|
||||
}
|
||||
|
||||
---@overload fun(): v2f
|
||||
---@overload fun(v: number): v2f
|
||||
---@overload fun(x: number, y: number): v2f
|
||||
---@overload fun(v: v2f): v2f
|
||||
---@overload fun(v: v3f): v2f
|
||||
---@overload fun(v: v4f): v2f
|
||||
---@return v2f
|
||||
function v2f.new(...) end
|
||||
|
||||
---@return v2f
|
||||
function v2f.zero() end
|
||||
|
||||
---@return v2f
|
||||
function v2f.unit() end
|
||||
|
||||
---@return v2f
|
||||
function v2f.unit_x() end
|
||||
|
||||
---@return v2f
|
||||
function v2f.unit_y() end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@return boolean
|
||||
function v2f.approximately(l, r) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@return number
|
||||
function v2f.dot(l, r) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@return number
|
||||
function v2f.abs_dot(l, r) end
|
||||
|
||||
---@param v v2f
|
||||
---@return number
|
||||
function v2f.length_squared(v) end
|
||||
|
||||
---@param v v2f
|
||||
---@return number
|
||||
function v2f.length(v) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@return number
|
||||
function v2f.distance_squared(l, r) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@return number
|
||||
function v2f.distance(l, r) end
|
||||
|
||||
---@param v v2f
|
||||
---@return v2f
|
||||
function v2f.normalized(v) end
|
||||
|
||||
---@param v v2f
|
||||
---@return number
|
||||
function v2f.minimum(v) end
|
||||
|
||||
---@param v v2f
|
||||
---@return number
|
||||
function v2f.maximum(v) end
|
||||
|
||||
---@param v v2f
|
||||
---@param vmin v2f
|
||||
---@return v2f
|
||||
function v2f.minimized(v,vmin) end
|
||||
|
||||
---@param v v2f
|
||||
---@param vmax v2f
|
||||
---@return v2f
|
||||
function v2f.maximized(v,vmax) end
|
||||
|
||||
---@param v v2f
|
||||
---@param vmin v2f
|
||||
---@param vmax v2f
|
||||
---@return v2f
|
||||
function v2f.clamped(v,vmin,vmax) end
|
||||
|
||||
---@param v v2f
|
||||
---@return v2f
|
||||
function v2f.saturated(v) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@param v number | v2f
|
||||
---@return v2f
|
||||
function v2f.lerp(l,r,v) end
|
||||
|
||||
---@param l v2f
|
||||
---@param r v2f
|
||||
---@param v v2f
|
||||
---@return v2f
|
||||
function v2f.inverse_lerp(l,r,v) end
|
||||
|
||||
---@type v2f
|
||||
_G.v2f = _G.v2f or v2f
|
||||
@@ -1,120 +0,0 @@
|
||||
---@class v3f
|
||||
local v3f = {
|
||||
---@type number
|
||||
x = 0,
|
||||
|
||||
---@type number
|
||||
y = 0,
|
||||
|
||||
---@type number
|
||||
z = 0
|
||||
}
|
||||
|
||||
---@overload fun(): v3f
|
||||
---@overload fun(v: number): v3f
|
||||
---@overload fun(x: number, y: number, z: number): v3f
|
||||
---@overload fun(v: v2f, z: number): v3f
|
||||
---@overload fun(v: v3f): v3f
|
||||
---@overload fun(v: v4f): v3f
|
||||
---@return v3f
|
||||
function v3f.new(...) end
|
||||
|
||||
---@return v3f
|
||||
function v3f.zero() end
|
||||
|
||||
---@return v3f
|
||||
function v3f.unit() end
|
||||
|
||||
---@return v3f
|
||||
function v3f.unit_x() end
|
||||
|
||||
---@return v3f
|
||||
function v3f.unit_y() end
|
||||
|
||||
---@return v3f
|
||||
function v3f.unit_z() end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return boolean
|
||||
function v3f.approximately(l, r) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return number
|
||||
function v3f.dot(l, r) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return number
|
||||
function v3f.abs_dot(l, r) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return v3f
|
||||
function v3f.cross(l, r) end
|
||||
|
||||
---@param v v3f
|
||||
---@return number
|
||||
function v3f.length_squared(v) end
|
||||
|
||||
---@param v v3f
|
||||
---@return number
|
||||
function v3f.length(v) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return number
|
||||
function v3f.distance_squared(l, r) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@return number
|
||||
function v3f.distance(l, r) end
|
||||
|
||||
---@param v v3f
|
||||
---@return v3f
|
||||
function v3f.normalized(v) end
|
||||
|
||||
---@param v v3f
|
||||
---@return number
|
||||
function v3f.minimum(v) end
|
||||
|
||||
---@param v v3f
|
||||
---@return number
|
||||
function v3f.maximum(v) end
|
||||
|
||||
---@param v v3f
|
||||
---@param vmin v3f
|
||||
---@return v3f
|
||||
function v3f.minimized(v,vmin) end
|
||||
|
||||
---@param v v3f
|
||||
---@param vmax v3f
|
||||
---@return v3f
|
||||
function v3f.maximized(v,vmax) end
|
||||
|
||||
---@param v v3f
|
||||
---@param vmin v3f
|
||||
---@param vmax v3f
|
||||
---@return v3f
|
||||
function v3f.clamped(v,vmin,vmax) end
|
||||
|
||||
---@param v v3f
|
||||
---@return v3f
|
||||
function v3f.saturated(v) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@param v number | v3f
|
||||
---@return v3f
|
||||
function v3f.lerp(l,r,v) end
|
||||
|
||||
---@param l v3f
|
||||
---@param r v3f
|
||||
---@param v v3f
|
||||
---@return v3f
|
||||
function v3f.inverse_lerp(l,r,v) end
|
||||
|
||||
---@type v3f
|
||||
_G.v3f = _G.v3f or v3f
|
||||
@@ -1,121 +0,0 @@
|
||||
---@class v4f
|
||||
local v4f = {
|
||||
---@type number
|
||||
x = 0,
|
||||
|
||||
---@type number
|
||||
y = 0,
|
||||
|
||||
---@type number
|
||||
z = 0,
|
||||
|
||||
---@type number
|
||||
w = 0
|
||||
}
|
||||
|
||||
---@overload fun(): v4f
|
||||
---@overload fun(v: number): v4f
|
||||
---@overload fun(x: number, y: number, z: number, w: number): v4f
|
||||
---@overload fun(v: v2f, z: number, w: number): v4f
|
||||
---@overload fun(v: v3f, w: number): v4f
|
||||
---@overload fun(v: v4f): v4f
|
||||
---@return v4f
|
||||
function v4f.new(...) end
|
||||
|
||||
---@return v4f
|
||||
function v4f.zero() end
|
||||
|
||||
---@return v4f
|
||||
function v4f.unit() end
|
||||
|
||||
---@return v4f
|
||||
function v4f.unit_x() end
|
||||
|
||||
---@return v4f
|
||||
function v4f.unit_y() end
|
||||
|
||||
---@return v4f
|
||||
function v4f.unit_z() end
|
||||
|
||||
---@return v4f
|
||||
function v4f.unit_w() end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@return boolean
|
||||
function v4f.approximately(l, r) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@return number
|
||||
function v4f.dot(l, r) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@return number
|
||||
function v4f.abs_dot(l, r) end
|
||||
|
||||
---@param v v4f
|
||||
---@return number
|
||||
function v4f.length_squared(v) end
|
||||
|
||||
---@param v v4f
|
||||
---@return number
|
||||
function v4f.length(v) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@return number
|
||||
function v4f.distance_squared(l, r) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@return number
|
||||
function v4f.distance(l, r) end
|
||||
|
||||
---@param v v4f
|
||||
---@return v4f
|
||||
function v4f.normalized(v) end
|
||||
|
||||
---@param v v4f
|
||||
---@return number
|
||||
function v4f.minimum(v) end
|
||||
|
||||
---@param v v4f
|
||||
---@return number
|
||||
function v4f.maximum(v) end
|
||||
|
||||
---@param v v4f
|
||||
---@param vmin v4f
|
||||
---@return v4f
|
||||
function v4f.minimized(v,vmin) end
|
||||
|
||||
---@param v v4f
|
||||
---@param vmax v4f
|
||||
---@return v4f
|
||||
function v4f.maximized(v,vmax) end
|
||||
|
||||
---@param v v4f
|
||||
---@param vmin v4f
|
||||
---@param vmax v4f
|
||||
---@return v4f
|
||||
function v4f.clamped(v,vmin,vmax) end
|
||||
|
||||
---@param v v4f
|
||||
---@return v4f
|
||||
function v4f.saturated(v) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@param v number | v4f
|
||||
---@return v4f
|
||||
function v4f.lerp(l,r,v) end
|
||||
|
||||
---@param l v4f
|
||||
---@param r v4f
|
||||
---@param v v4f
|
||||
---@return v4f
|
||||
function v4f.inverse_lerp(l,r,v) end
|
||||
|
||||
---@type v4f
|
||||
_G.v4f = _G.v4f or v4f
|
||||
@@ -1,82 +0,0 @@
|
||||
---@class color
|
||||
local color = {
|
||||
---@type number
|
||||
r = 1.0,
|
||||
|
||||
---@type number
|
||||
g = 1.0,
|
||||
|
||||
---@type number
|
||||
b = 1.0,
|
||||
|
||||
---@type number
|
||||
a = 1.0
|
||||
}
|
||||
|
||||
---@overload fun(): color
|
||||
---@overload fun(c: color): color
|
||||
---@overload fun(c: color32): color
|
||||
---@overload fun(v: v4f): color
|
||||
---@overload fun(v: v3f, a: number): color
|
||||
---@overload fun(r: number, g: number, b: number, a: number): color
|
||||
---@return color
|
||||
function color.new(...) end
|
||||
|
||||
---@return color
|
||||
function color.clear() end
|
||||
|
||||
---@return color
|
||||
function color.black() end
|
||||
|
||||
---@return color
|
||||
function color.white() end
|
||||
|
||||
---@return color
|
||||
function color.red() end
|
||||
|
||||
---@return color
|
||||
function color.green() end
|
||||
|
||||
---@return color
|
||||
function color.blue() end
|
||||
|
||||
---@return color
|
||||
function color.yellow() end
|
||||
|
||||
---@return color
|
||||
function color.magenta() end
|
||||
|
||||
---@return color
|
||||
function color.cyan() end
|
||||
|
||||
---@param l color
|
||||
---@param r color
|
||||
---@return boolean
|
||||
function color.approximately(l, r) end
|
||||
|
||||
---@param c color
|
||||
---@return number
|
||||
function color.minimum(c) end
|
||||
|
||||
---@param c color
|
||||
---@return number
|
||||
function color.maximum(c) end
|
||||
|
||||
---@param c color
|
||||
---@param cmin color
|
||||
---@return color
|
||||
function color.minimized(c,cmin) end
|
||||
|
||||
---@param c color
|
||||
---@param cmax color
|
||||
---@return color
|
||||
function color.maximized(c,cmax) end
|
||||
|
||||
---@param c color
|
||||
---@param cmin color
|
||||
---@param cmax color
|
||||
---@return color
|
||||
function color.clamped(c,cmin,cmax) end
|
||||
|
||||
---@type color
|
||||
_G.color = _G.color or color
|
||||
@@ -1,82 +0,0 @@
|
||||
---@class color32
|
||||
local color32 = {
|
||||
---@type number
|
||||
r = 255,
|
||||
|
||||
---@type number
|
||||
g = 255,
|
||||
|
||||
---@type number
|
||||
b = 255,
|
||||
|
||||
---@type number
|
||||
a = 255
|
||||
}
|
||||
|
||||
---@overload fun(): color32
|
||||
---@overload fun(c: color): color32
|
||||
---@overload fun(c: color32): color32
|
||||
---@overload fun(v: v4f): color32
|
||||
---@overload fun(v: v3f, a: number): color32
|
||||
---@overload fun(r: number, g: number, b: number, a: number): color32
|
||||
---@return color32
|
||||
function color32.new(...) end
|
||||
|
||||
---@return color32
|
||||
function color32.clear() end
|
||||
|
||||
---@return color32
|
||||
function color32.black() end
|
||||
|
||||
---@return color32
|
||||
function color32.white() end
|
||||
|
||||
---@return color32
|
||||
function color32.red() end
|
||||
|
||||
---@return color32
|
||||
function color32.green() end
|
||||
|
||||
---@return color32
|
||||
function color32.blue() end
|
||||
|
||||
---@return color32
|
||||
function color32.yellow() end
|
||||
|
||||
---@return color32
|
||||
function color32.magenta() end
|
||||
|
||||
---@return color32
|
||||
function color32.cyan() end
|
||||
|
||||
---@param l color32
|
||||
---@param r color32
|
||||
---@return boolean
|
||||
function color32.approximately(l, r) end
|
||||
|
||||
---@param c color32
|
||||
---@return number
|
||||
function color32.minimum(c) end
|
||||
|
||||
---@param c color32
|
||||
---@return number
|
||||
function color32.maximum(c) end
|
||||
|
||||
---@param c color32
|
||||
---@param cmin color32
|
||||
---@return color32
|
||||
function color32.minimized(c,cmin) end
|
||||
|
||||
---@param c color32
|
||||
---@param cmax color32
|
||||
---@return color32
|
||||
function color32.maximized(c,cmax) end
|
||||
|
||||
---@param c color32
|
||||
---@param cmin color32
|
||||
---@param cmax color32
|
||||
---@return color32
|
||||
function color32.clamped(c,cmin,cmax) end
|
||||
|
||||
---@type color32
|
||||
_G.color32 = _G.color32 or color32
|
||||
@@ -1,20 +0,0 @@
|
||||
---@class str_hash
|
||||
local str_hash = {
|
||||
---@type boolean
|
||||
empty = true,
|
||||
|
||||
---@type number
|
||||
hash = 0
|
||||
}
|
||||
|
||||
---@overload fun(): str_hash
|
||||
---@overload fun(s: string): str_hash
|
||||
---@return str_hash
|
||||
function str_hash.new(...) end
|
||||
|
||||
---@overload fun(s: str_hash)
|
||||
---@param s str_hash
|
||||
function str_hash.clear(s) end
|
||||
|
||||
---@type str_hash
|
||||
_G.str_hash = _G.str_hash or str_hash
|
||||
@@ -1,40 +0,0 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- private
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@class fps_label_meta
|
||||
---@field last_fps number
|
||||
|
||||
---@param meta fps_label_meta
|
||||
---@param go gobject
|
||||
local function update_label_text(meta, go)
|
||||
local curr_fps = the_engine.frame_rate
|
||||
if meta.last_fps ~= curr_fps then
|
||||
meta.last_fps = curr_fps
|
||||
go.label.text = "FPS: " .. curr_fps
|
||||
end
|
||||
end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- meta
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param meta fps_label_meta
|
||||
---@param go gobject
|
||||
function M.on_start(meta, go)
|
||||
meta.last_fps = -1
|
||||
end
|
||||
|
||||
---@param meta fps_label_meta
|
||||
---@param go gobject
|
||||
function M.on_update(meta, go)
|
||||
update_label_text(meta, go)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,48 +0,0 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- private
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@class gnome_meta
|
||||
---@field life_time number
|
||||
|
||||
---@param meta gnome_meta
|
||||
---@param go gobject
|
||||
local function update_life_time(meta, go)
|
||||
local dt = the_engine.delta_time
|
||||
meta.life_time = meta.life_time - dt
|
||||
if meta.life_time <= 0 then
|
||||
go:destroy()
|
||||
end
|
||||
end
|
||||
|
||||
---@param meta gnome_meta
|
||||
---@param go gobject
|
||||
local function update_gnome_rotation(meta, go)
|
||||
local time = the_engine.time
|
||||
go.renderer.rotation = v3f.new(0, time, 0)
|
||||
end
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- meta
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param meta gnome_meta
|
||||
---@param go gobject
|
||||
function M.on_start(meta, go)
|
||||
meta.life_time = 5
|
||||
end
|
||||
|
||||
---@param meta gnome_meta
|
||||
---@param go gobject
|
||||
function M.on_update(meta, go)
|
||||
update_life_time(meta, go)
|
||||
update_gnome_rotation(meta, go)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,22 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
---@param go gobject
|
||||
function M:on_start(go)
|
||||
the_debug:trace("sample_07: on_start")
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
function M:on_update(go)
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
---@param type string
|
||||
---@param event any
|
||||
function M:on_event(go, type, event)
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
function M:on_shutdown(go)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,29 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
---@param go gobject
|
||||
function M:on_start(go)
|
||||
the_debug:trace("sample_08: on_start")
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
function M:on_update(go)
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
---@param type string
|
||||
---@param event touchable_base_evt | touchable_mouse_evt
|
||||
function M:on_event(go, type, event)
|
||||
if type == "touchable.mouse_evt" then
|
||||
the_debug:trace(string.format(
|
||||
"scene %q touched(%s %s)",
|
||||
go.named and go.named.name or "---",
|
||||
event.type,
|
||||
event.button))
|
||||
end
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
function M:on_shutdown(go)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,41 +0,0 @@
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- private
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
---@class ship_meta
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
--
|
||||
-- meta
|
||||
--
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param meta ship_meta
|
||||
---@param go gobject
|
||||
function M.on_start(meta, go)
|
||||
end
|
||||
|
||||
---@param meta ship_meta
|
||||
---@param go gobject
|
||||
function M.on_update(meta, go)
|
||||
end
|
||||
|
||||
---@param go gobject
|
||||
---@param type string
|
||||
---@param event touchable_mouse_evt
|
||||
function M:on_event(go, type, event)
|
||||
if type == "touchable.mouse_evt" then
|
||||
the_debug:trace(string.format(
|
||||
"ship %q touched(%s %s) - %s",
|
||||
go.named and go.named.name or "---",
|
||||
event.type,
|
||||
event.button,
|
||||
go == event.target and "self" or "other"))
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user