@gamely/gly-engine-lite 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.lua +183 -201
- package/package.json +2 -1
- package/types/main.d.ts +4 -0
package/dist/main.lua
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
local math = ((function() local x, y = pcall(require, 'math'); return x and y end)()) or _G.math
|
|
2
|
-
local
|
|
3
|
-
local
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local
|
|
8
|
-
local
|
|
9
|
-
local
|
|
10
|
-
local
|
|
11
|
-
local
|
|
12
|
-
local
|
|
13
|
-
local
|
|
14
|
-
local
|
|
15
|
-
local
|
|
16
|
-
local
|
|
17
|
-
local
|
|
18
|
-
local
|
|
19
|
-
local
|
|
20
|
-
local
|
|
21
|
-
local
|
|
22
|
-
local
|
|
23
|
-
local
|
|
24
|
-
local
|
|
25
|
-
local function
|
|
26
|
-
local version =
|
|
27
|
-
local zeebo_module =
|
|
28
|
-
local engine_encoder =
|
|
29
|
-
local engine_game =
|
|
30
|
-
local engine_hash =
|
|
31
|
-
local engine_http =
|
|
32
|
-
local engine_i18n =
|
|
33
|
-
local engine_key =
|
|
34
|
-
local engine_log =
|
|
35
|
-
local engine_math =
|
|
36
|
-
local engine_array =
|
|
37
|
-
local engine_media =
|
|
38
|
-
local engine_draw_fps =
|
|
39
|
-
local engine_draw_text =
|
|
40
|
-
local engine_draw_poly =
|
|
41
|
-
local engine_raw_memory =
|
|
42
|
-
local callback_http =
|
|
43
|
-
local application_default =
|
|
44
|
-
local color =
|
|
45
|
-
local std =
|
|
2
|
+
local src_version_55789ed81210 = nil
|
|
3
|
+
local src_lib_common_module_55789ed58c40 = nil
|
|
4
|
+
local src_lib_engine_api_encoder_55789ed92660 = nil
|
|
5
|
+
local src_lib_engine_api_app_55789eda8c90 = nil
|
|
6
|
+
local src_lib_engine_api_hash_55789ed5fba0 = nil
|
|
7
|
+
local src_lib_engine_api_http_55789ed73940 = nil
|
|
8
|
+
local src_lib_engine_api_i18n_55789ed73390 = nil
|
|
9
|
+
local src_lib_engine_api_key_55789ed67430 = nil
|
|
10
|
+
local src_lib_engine_api_log_55789ed6ec50 = nil
|
|
11
|
+
local src_lib_engine_api_math_55789ed97690 = nil
|
|
12
|
+
local src_lib_engine_api_array_55789ed6a870 = nil
|
|
13
|
+
local src_lib_engine_api_media_55789ed5bbd0 = nil
|
|
14
|
+
local src_lib_engine_draw_fps_55789edb30e0 = nil
|
|
15
|
+
local src_lib_engine_draw_text_55789ed7cb30 = nil
|
|
16
|
+
local src_lib_engine_draw_poly_55789ed758d0 = nil
|
|
17
|
+
local src_lib_engine_raw_memory_55789ed6cc30 = nil
|
|
18
|
+
local src_lib_protocol_http_callback_55789ed506b0 = nil
|
|
19
|
+
local src_lib_object_root_55789ed7d4c0 = nil
|
|
20
|
+
local src_lib_object_color_55789edbd130 = nil
|
|
21
|
+
local src_lib_object_std_55789ed51260 = nil
|
|
22
|
+
local src_lib_util_pipeline_55789ed7d870 = nil
|
|
23
|
+
local src_lib_util_decorator_55789ed6a3c0 = nil
|
|
24
|
+
local src_lib_util_http_55789eda0210 = nil
|
|
25
|
+
local function main_55789ed4b7f0()
|
|
26
|
+
local version = src_version_55789ed81210()
|
|
27
|
+
local zeebo_module = src_lib_common_module_55789ed58c40()
|
|
28
|
+
local engine_encoder = src_lib_engine_api_encoder_55789ed92660()
|
|
29
|
+
local engine_game = src_lib_engine_api_app_55789eda8c90()
|
|
30
|
+
local engine_hash = src_lib_engine_api_hash_55789ed5fba0()
|
|
31
|
+
local engine_http = src_lib_engine_api_http_55789ed73940()
|
|
32
|
+
local engine_i18n = src_lib_engine_api_i18n_55789ed73390()
|
|
33
|
+
local engine_key = src_lib_engine_api_key_55789ed67430()
|
|
34
|
+
local engine_log = src_lib_engine_api_log_55789ed6ec50()
|
|
35
|
+
local engine_math = src_lib_engine_api_math_55789ed97690()
|
|
36
|
+
local engine_array = src_lib_engine_api_array_55789ed6a870()
|
|
37
|
+
local engine_media = src_lib_engine_api_media_55789ed5bbd0()
|
|
38
|
+
local engine_draw_fps = src_lib_engine_draw_fps_55789edb30e0()
|
|
39
|
+
local engine_draw_text = src_lib_engine_draw_text_55789ed7cb30()
|
|
40
|
+
local engine_draw_poly = src_lib_engine_draw_poly_55789ed758d0()
|
|
41
|
+
local engine_raw_memory = src_lib_engine_raw_memory_55789ed6cc30()
|
|
42
|
+
local callback_http = src_lib_protocol_http_callback_55789ed506b0()
|
|
43
|
+
local application_default = src_lib_object_root_55789ed7d4c0()
|
|
44
|
+
local color = src_lib_object_color_55789edbd130()
|
|
45
|
+
local std = src_lib_object_std_55789ed51260()
|
|
46
46
|
local application = application_default
|
|
47
47
|
local engine = {
|
|
48
48
|
keyboard = function(a, b, c, d) end,
|
|
@@ -148,7 +148,9 @@ std.draw.color=native_draw_color
|
|
|
148
148
|
std.draw.font=native_draw_font
|
|
149
149
|
std.draw.rect=native_draw_rect
|
|
150
150
|
std.draw.line=native_draw_line
|
|
151
|
-
std.draw.image=
|
|
151
|
+
std.draw.image=native_image_draw
|
|
152
|
+
std.image.load=native_image_load
|
|
153
|
+
std.image.draw=native_image_draw
|
|
152
154
|
std.text.print=native_text_print
|
|
153
155
|
std.text.mensure=native_text_mensure
|
|
154
156
|
std.text.font_size=native_text_font_size
|
|
@@ -170,6 +172,7 @@ zeebo_module.require(std, application, engine)
|
|
|
170
172
|
:package('@color', color)
|
|
171
173
|
:package('@log', engine_log, cfg_log)
|
|
172
174
|
:package('math', engine_math.clib)
|
|
175
|
+
:package('math.wave', engine_math.wave)
|
|
173
176
|
:package('math.random', engine_math.clib_random)
|
|
174
177
|
:package('http', engine_http, cfg_http)
|
|
175
178
|
:package('base64', engine_encoder, cfg_base64)
|
|
@@ -198,13 +201,13 @@ version=version
|
|
|
198
201
|
}
|
|
199
202
|
return P
|
|
200
203
|
end
|
|
201
|
-
|
|
202
|
-
return '0.0.
|
|
204
|
+
src_version_55789ed81210 = function()
|
|
205
|
+
return '0.0.20'
|
|
203
206
|
end
|
|
204
207
|
--
|
|
205
|
-
|
|
206
|
-
local zeebo_pipeline =
|
|
207
|
-
local application_default =
|
|
208
|
+
src_lib_common_module_55789ed58c40 = function()
|
|
209
|
+
local zeebo_pipeline = src_lib_util_pipeline_55789ed7d870()
|
|
210
|
+
local application_default = src_lib_object_root_55789ed7d4c0()
|
|
208
211
|
local function default(application, defaults)
|
|
209
212
|
if not application then return nil end
|
|
210
213
|
local index = 1
|
|
@@ -402,7 +405,7 @@ require = require
|
|
|
402
405
|
return P
|
|
403
406
|
end
|
|
404
407
|
--
|
|
405
|
-
|
|
408
|
+
src_lib_engine_api_encoder_55789ed92660 = function()
|
|
406
409
|
local function install(std, engine, library, name)
|
|
407
410
|
std = std or {}
|
|
408
411
|
std[name] = {
|
|
@@ -417,8 +420,8 @@ install=install
|
|
|
417
420
|
return P
|
|
418
421
|
end
|
|
419
422
|
--
|
|
420
|
-
|
|
421
|
-
local util_decorator =
|
|
423
|
+
src_lib_engine_api_app_55789eda8c90 = function()
|
|
424
|
+
local util_decorator = src_lib_util_decorator_55789ed6a3c0()
|
|
422
425
|
local function reset(std, engine)
|
|
423
426
|
if std.node then
|
|
424
427
|
std.bus.emit('exit')
|
|
@@ -458,7 +461,7 @@ install=install
|
|
|
458
461
|
return P
|
|
459
462
|
end
|
|
460
463
|
--
|
|
461
|
-
|
|
464
|
+
src_lib_engine_api_hash_55789ed5fba0 = function()
|
|
462
465
|
local function djb2(digest)
|
|
463
466
|
local index = 1
|
|
464
467
|
local hash = 5381
|
|
@@ -484,8 +487,8 @@ install = install
|
|
|
484
487
|
return P
|
|
485
488
|
end
|
|
486
489
|
--
|
|
487
|
-
|
|
488
|
-
local zeebo_pipeline =
|
|
490
|
+
src_lib_engine_api_http_55789ed73940 = function()
|
|
491
|
+
local zeebo_pipeline = src_lib_util_pipeline_55789ed7d870()
|
|
489
492
|
local function fast(self)
|
|
490
493
|
self.speed = '_fast'
|
|
491
494
|
return self
|
|
@@ -574,7 +577,10 @@ function()
|
|
|
574
577
|
callback_handler(std, game)
|
|
575
578
|
if std.http.ok then
|
|
576
579
|
self.success_handler(std, game)
|
|
577
|
-
elseif std.http.error
|
|
580
|
+
elseif std.http.error then
|
|
581
|
+
self.error_handler(std, game)
|
|
582
|
+
elseif not std.http.status then
|
|
583
|
+
self.set('error', 'missing protocol response')
|
|
578
584
|
self.error_handler(std, game)
|
|
579
585
|
else
|
|
580
586
|
self.failed_handler(std, game)
|
|
@@ -595,7 +601,7 @@ return self
|
|
|
595
601
|
end
|
|
596
602
|
end
|
|
597
603
|
local function install(std, engine, protocol)
|
|
598
|
-
assert(protocol.handler, 'missing protocol handler')
|
|
604
|
+
assert(protocol and protocol.handler, 'missing protocol handler')
|
|
599
605
|
if protocol.has_callback then
|
|
600
606
|
engine.http_count = 0
|
|
601
607
|
engine.http_requests = {}
|
|
@@ -617,7 +623,7 @@ install=install
|
|
|
617
623
|
return P
|
|
618
624
|
end
|
|
619
625
|
--
|
|
620
|
-
|
|
626
|
+
src_lib_engine_api_i18n_55789ed73390 = function()
|
|
621
627
|
local language = 'en-US'
|
|
622
628
|
local language_default = 'en-US'
|
|
623
629
|
local language_list = {}
|
|
@@ -709,7 +715,7 @@ install=install
|
|
|
709
715
|
return P
|
|
710
716
|
end
|
|
711
717
|
--
|
|
712
|
-
|
|
718
|
+
src_lib_engine_api_key_55789ed67430 = function()
|
|
713
719
|
local function real_key(std, engine, rkey, rvalue)
|
|
714
720
|
local value = rvalue == 1 or rvalue == true
|
|
715
721
|
local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
|
|
@@ -749,8 +755,8 @@ install = install
|
|
|
749
755
|
return P
|
|
750
756
|
end
|
|
751
757
|
--
|
|
752
|
-
|
|
753
|
-
local util_decorator =
|
|
758
|
+
src_lib_engine_api_log_55789ed6ec50 = function()
|
|
759
|
+
local util_decorator = src_lib_util_decorator_55789ed6a3c0()
|
|
754
760
|
local logging_types = {
|
|
755
761
|
'none', 'fatal', 'error', 'warn', 'debug', 'info'
|
|
756
762
|
}
|
|
@@ -796,7 +802,7 @@ install = install
|
|
|
796
802
|
return P
|
|
797
803
|
end
|
|
798
804
|
--
|
|
799
|
-
|
|
805
|
+
src_lib_engine_api_math_55789ed97690 = function()
|
|
800
806
|
local function abs(value)
|
|
801
807
|
if value < 0 then
|
|
802
808
|
return -value
|
|
@@ -875,8 +881,31 @@ index = index + 1
|
|
|
875
881
|
end
|
|
876
882
|
return min_value
|
|
877
883
|
end
|
|
884
|
+
local function sine(t, freq)
|
|
885
|
+
return math.pi and math.sin(2 * math.pi * freq * t) or 1
|
|
886
|
+
end
|
|
887
|
+
local function ramp(t, freq, ratio)
|
|
888
|
+
t = (t / 2) % (1 / freq) * freq
|
|
889
|
+
if t < ratio then
|
|
890
|
+
return 2 * t / ratio - 1
|
|
891
|
+
else
|
|
892
|
+
return (2 * t - ratio - 1) / (ratio - 1)
|
|
893
|
+
end
|
|
894
|
+
end
|
|
895
|
+
local function saw(t, freq)
|
|
896
|
+
return ramp(t, freq, 1)
|
|
897
|
+
end
|
|
898
|
+
local function triangle(t, freq)
|
|
899
|
+
return ramp(t, freq, 1/2)
|
|
900
|
+
end
|
|
901
|
+
local function rect(t, freq, duty)
|
|
902
|
+
duty = 1 - duty * 2
|
|
903
|
+
return saw(t, freq) > duty and 1 or -1
|
|
904
|
+
end
|
|
905
|
+
local function square(t, freq)
|
|
906
|
+
return rect(t, freq, 1/2)
|
|
907
|
+
end
|
|
878
908
|
local function install(std)
|
|
879
|
-
std = std or {}
|
|
880
909
|
std.math = std.math or {}
|
|
881
910
|
std.math.abs=abs
|
|
882
911
|
std.math.clamp=clamp
|
|
@@ -889,10 +918,15 @@ std.math.lerp=lerp
|
|
|
889
918
|
std.math.map=map
|
|
890
919
|
std.math.max=max
|
|
891
920
|
std.math.min=min
|
|
892
|
-
|
|
921
|
+
end
|
|
922
|
+
local function install_wave(std)
|
|
923
|
+
std.math = std.math or {}
|
|
924
|
+
std.math.sine=sine
|
|
925
|
+
std.math.saw=saw
|
|
926
|
+
std.math.square=square
|
|
927
|
+
std.math.triangle=triangle
|
|
893
928
|
end
|
|
894
929
|
local function install_clib(std)
|
|
895
|
-
std = std or {}
|
|
896
930
|
std.math = std.math or {}
|
|
897
931
|
std.math.acos=math.acos
|
|
898
932
|
std.math.asin=math.asin
|
|
@@ -919,20 +953,20 @@ std.math.sinh=math.sinh
|
|
|
919
953
|
std.math.sqrt=math.sqrt
|
|
920
954
|
std.math.tan=math.tan
|
|
921
955
|
std.math.tanh=math.tanh
|
|
922
|
-
return std.math
|
|
923
956
|
end
|
|
924
957
|
local function install_clib_random(std)
|
|
925
|
-
std = std or {}
|
|
926
958
|
std.math = std.math or {}
|
|
927
959
|
std.math.random = function(a, b)
|
|
928
960
|
a = a and math.floor(a)
|
|
929
961
|
b = b and math.floor(b)
|
|
930
962
|
return math.random(a, b)
|
|
931
963
|
end
|
|
932
|
-
return std.math
|
|
933
964
|
end
|
|
934
965
|
local P = {
|
|
935
966
|
install = install,
|
|
967
|
+
wave = {
|
|
968
|
+
install = install_wave
|
|
969
|
+
},
|
|
936
970
|
clib = {
|
|
937
971
|
install = install_clib
|
|
938
972
|
},
|
|
@@ -943,8 +977,8 @@ install = install_clib_random
|
|
|
943
977
|
return P;
|
|
944
978
|
end
|
|
945
979
|
--
|
|
946
|
-
|
|
947
|
-
local util_decorator =
|
|
980
|
+
src_lib_engine_api_array_55789ed6a870 = function()
|
|
981
|
+
local util_decorator = src_lib_util_decorator_55789ed6a3c0()
|
|
948
982
|
local function array_map(array, func)
|
|
949
983
|
local res = {}
|
|
950
984
|
local index = 1
|
|
@@ -1105,77 +1139,40 @@ install = install
|
|
|
1105
1139
|
return P
|
|
1106
1140
|
end
|
|
1107
1141
|
--
|
|
1108
|
-
|
|
1109
|
-
local
|
|
1110
|
-
local function
|
|
1111
|
-
func
|
|
1112
|
-
return self
|
|
1113
|
-
|
|
1114
|
-
local function media_play(media, func, self)
|
|
1115
|
-
func(media - 1, self.id - 1)
|
|
1142
|
+
src_lib_engine_api_media_55789ed5bbd0 = function()
|
|
1143
|
+
local function media_create(node, channels, handler)
|
|
1144
|
+
local decorator = function(func)
|
|
1145
|
+
func = func or function() end
|
|
1146
|
+
return function(self, a, b, c)
|
|
1147
|
+
func(0, a, b, c)
|
|
1116
1148
|
return self
|
|
1117
1149
|
end
|
|
1118
|
-
local function media_pause(media, func, self)
|
|
1119
|
-
func(media - 1, self.id - 1)
|
|
1120
|
-
return self
|
|
1121
1150
|
end
|
|
1122
|
-
local
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
local channels = std.media.channels[mediaid]
|
|
1133
|
-
id = id or 1
|
|
1134
|
-
if 0 >= id or id > max_channels then
|
|
1135
|
-
error('Please, do not do that!')
|
|
1136
|
-
end
|
|
1137
|
-
if not channels[id] then
|
|
1138
|
-
channels[id] = {
|
|
1139
|
-
id = id,
|
|
1140
|
-
add = util_decorator.prefix2(mediaid, handler.load, media_add),
|
|
1141
|
-
play = util_decorator.prefix2(mediaid, handler.play, media_play),
|
|
1142
|
-
pause = util_decorator.prefix2(mediaid, handler.pause, media_pause),
|
|
1143
|
-
resize = util_decorator.prefix2(mediaid, handler.resize, media_resize),
|
|
1144
|
-
position = util_decorator.prefix2(mediaid, handler.position, media_position)
|
|
1151
|
+
local self = {
|
|
1152
|
+
src = decorator(handler.source),
|
|
1153
|
+
play = decorator(handler.play),
|
|
1154
|
+
pause = decorator(handler.pause),
|
|
1155
|
+
resume = decorator(handler.resume),
|
|
1156
|
+
stop = decorator(handler.stop),
|
|
1157
|
+
position = decorator(handler.position),
|
|
1158
|
+
resize = decorator(handler.resize),
|
|
1159
|
+
node = node,
|
|
1160
|
+
apply = function() end
|
|
1145
1161
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
channels[id].apply = function()
|
|
1149
|
-
local node = channels[id].node
|
|
1150
|
-
local depth = 0
|
|
1151
|
-
local offset_x = 0
|
|
1152
|
-
local offset_y = 0
|
|
1153
|
-
while node and depth < 100 do
|
|
1154
|
-
offset_x = offset_x + node.config.offset_x
|
|
1155
|
-
offset_y = offset_y + node.config.offset_y
|
|
1156
|
-
node = node.config.parent
|
|
1157
|
-
depth = depth + 1
|
|
1158
|
-
end
|
|
1159
|
-
media_position(handler.position, channels[id], offset_x, offset_y)
|
|
1160
|
-
media_resize(handler.resize, channels[id], channels[id].node.data.width, channels[id].node.data.height)
|
|
1161
|
-
end
|
|
1162
|
-
end
|
|
1163
|
-
end
|
|
1164
|
-
return channels[id]
|
|
1162
|
+
return function()
|
|
1163
|
+
return self
|
|
1165
1164
|
end
|
|
1166
1165
|
end
|
|
1167
|
-
local function install(std, engine,
|
|
1168
|
-
handlers = handlers or {}
|
|
1166
|
+
local function install(std, engine, handler, name)
|
|
1169
1167
|
std.media = std.media or {}
|
|
1170
|
-
std.media.types = std.media.types or {}
|
|
1171
|
-
std.media.channels = std.media.channels or {}
|
|
1172
1168
|
local mediatype = name:match('%w+%.(%w+)')
|
|
1173
|
-
local mediaid = #std.media.types + 1
|
|
1174
1169
|
if not std.media[mediatype] then
|
|
1175
|
-
local
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1170
|
+
local channels = handler.bootstrap and handler.bootstrap(mediatype)
|
|
1171
|
+
if (not channels or channels == 0) and handler.bootstrap then
|
|
1172
|
+
error('media '..mediatype..' is not supported!')
|
|
1173
|
+
end
|
|
1174
|
+
local node = std.node and std.node.load({})
|
|
1175
|
+
std.media[mediatype] = media_create(node, channels, handler)
|
|
1179
1176
|
end
|
|
1180
1177
|
end
|
|
1181
1178
|
local P = {
|
|
@@ -1184,7 +1181,7 @@ install=install
|
|
|
1184
1181
|
return P
|
|
1185
1182
|
end
|
|
1186
1183
|
--
|
|
1187
|
-
|
|
1184
|
+
src_lib_engine_draw_fps_55789edb30e0 = function()
|
|
1188
1185
|
local function draw_fps(std, engine, show, pos_x, pos_y)
|
|
1189
1186
|
if show < 1 then return end
|
|
1190
1187
|
local x = engine.current.config.offset_x + pos_x
|
|
@@ -1236,8 +1233,8 @@ install=install
|
|
|
1236
1233
|
return P
|
|
1237
1234
|
end
|
|
1238
1235
|
--
|
|
1239
|
-
|
|
1240
|
-
local util_decorator =
|
|
1236
|
+
src_lib_engine_draw_text_55789ed7cb30 = function()
|
|
1237
|
+
local util_decorator = src_lib_util_decorator_55789ed6a3c0()
|
|
1241
1238
|
local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
|
|
1242
1239
|
size = size or 2
|
|
1243
1240
|
local hem = engine.current.data.width / 80
|
|
@@ -1264,7 +1261,7 @@ install=install
|
|
|
1264
1261
|
return P
|
|
1265
1262
|
end
|
|
1266
1263
|
--
|
|
1267
|
-
|
|
1264
|
+
src_lib_engine_draw_poly_55789ed758d0 = function()
|
|
1268
1265
|
local function decorator_poo(object, func)
|
|
1269
1266
|
if not object or not func then return func end
|
|
1270
1267
|
return function(a, b, c, d)
|
|
@@ -1371,7 +1368,7 @@ install=install
|
|
|
1371
1368
|
return P
|
|
1372
1369
|
end
|
|
1373
1370
|
--
|
|
1374
|
-
|
|
1371
|
+
src_lib_engine_raw_memory_55789ed6cc30 = function()
|
|
1375
1372
|
local memory_dict_unload = {}
|
|
1376
1373
|
local memory_dict = {}
|
|
1377
1374
|
local memory_list = {}
|
|
@@ -1426,8 +1423,8 @@ install=install
|
|
|
1426
1423
|
return P
|
|
1427
1424
|
end
|
|
1428
1425
|
--
|
|
1429
|
-
|
|
1430
|
-
local http_util =
|
|
1426
|
+
src_lib_protocol_http_callback_55789ed506b0 = function()
|
|
1427
|
+
local http_util = src_lib_util_http_55789eda0210()
|
|
1431
1428
|
local callbacks = {
|
|
1432
1429
|
['async-promise'] = function(self)
|
|
1433
1430
|
return self:promise()
|
|
@@ -1494,7 +1491,7 @@ func = native_http_callback
|
|
|
1494
1491
|
return P
|
|
1495
1492
|
end
|
|
1496
1493
|
--
|
|
1497
|
-
|
|
1494
|
+
src_lib_object_root_55789ed7d4c0 = function()
|
|
1498
1495
|
local P = {
|
|
1499
1496
|
data={
|
|
1500
1497
|
width=1280,
|
|
@@ -1524,61 +1521,34 @@ callbacks={
|
|
|
1524
1521
|
return P;
|
|
1525
1522
|
end
|
|
1526
1523
|
--
|
|
1527
|
-
|
|
1528
|
-
local white = 0xFFFFFFFF
|
|
1529
|
-
local lightgray = 0xC8CCCCFF
|
|
1530
|
-
local gray = 0x828282FF
|
|
1531
|
-
local darkgray = 0x505050FF
|
|
1532
|
-
local yellow = 0xFDF900FF
|
|
1533
|
-
local gold = 0xFFCB00FF
|
|
1534
|
-
local orange = 0xFFA100FF
|
|
1535
|
-
local pink = 0xFF6DC2FF
|
|
1536
|
-
local red = 0xE62937FF
|
|
1537
|
-
local maroon = 0xBE2137FF
|
|
1538
|
-
local green = 0x00E430FF
|
|
1539
|
-
local lime = 0x009E2FFF
|
|
1540
|
-
local darkgreen = 0x00752CFF
|
|
1541
|
-
local skyblue = 0x66BFFFFF
|
|
1542
|
-
local blue = 0x0079F1FF
|
|
1543
|
-
local darkblue = 0x0052ACFF
|
|
1544
|
-
local purple = 0xC87AFFFF
|
|
1545
|
-
local violet = 0x873CBEFF
|
|
1546
|
-
local darkpurple = 0x701F7EFF
|
|
1547
|
-
local beige = 0xD3B083FF
|
|
1548
|
-
local brown = 0x7F6A4FFF
|
|
1549
|
-
local darkbrown = 0x4C3F2FFF
|
|
1550
|
-
local black = 0x000000FF
|
|
1551
|
-
local blank = 0x00000000
|
|
1552
|
-
local magenta = 0xFF00FFFF
|
|
1524
|
+
src_lib_object_color_55789edbd130 = function()
|
|
1553
1525
|
local function install(std)
|
|
1554
|
-
std = std or {}
|
|
1555
1526
|
std.color = std.color or {}
|
|
1556
|
-
std.color.white =
|
|
1557
|
-
std.color.lightgray =
|
|
1558
|
-
std.color.gray =
|
|
1559
|
-
std.color.darkgray =
|
|
1560
|
-
std.color.yellow =
|
|
1561
|
-
std.color.gold =
|
|
1562
|
-
std.color.orange =
|
|
1563
|
-
std.color.pink =
|
|
1564
|
-
std.color.red =
|
|
1565
|
-
std.color.maroon =
|
|
1566
|
-
std.color.green =
|
|
1567
|
-
std.color.lime =
|
|
1568
|
-
std.color.darkgreen =
|
|
1569
|
-
std.color.skyblue =
|
|
1570
|
-
std.color.blue =
|
|
1571
|
-
std.color.darkblue =
|
|
1572
|
-
std.color.purple =
|
|
1573
|
-
std.color.violet =
|
|
1574
|
-
std.color.darkpurple =
|
|
1575
|
-
std.color.beige =
|
|
1576
|
-
std.color.brown =
|
|
1577
|
-
std.color.darkbrown =
|
|
1578
|
-
std.color.black =
|
|
1579
|
-
std.color.blank =
|
|
1580
|
-
std.color.magenta =
|
|
1581
|
-
return std.color
|
|
1527
|
+
std.color.white = 0xFFFFFFFF
|
|
1528
|
+
std.color.lightgray = 0xC8CCCCFF
|
|
1529
|
+
std.color.gray = 0x828282FF
|
|
1530
|
+
std.color.darkgray = 0x505050FF
|
|
1531
|
+
std.color.yellow = 0xFDF900FF
|
|
1532
|
+
std.color.gold = 0xFFCB00FF
|
|
1533
|
+
std.color.orange = 0xFFA100FF
|
|
1534
|
+
std.color.pink = 0xFF6DC2FF
|
|
1535
|
+
std.color.red = 0xE62937FF
|
|
1536
|
+
std.color.maroon = 0xBE2137FF
|
|
1537
|
+
std.color.green = 0x00E430FF
|
|
1538
|
+
std.color.lime = 0x009E2FFF
|
|
1539
|
+
std.color.darkgreen = 0x00752CFF
|
|
1540
|
+
std.color.skyblue = 0x66BFFFFF
|
|
1541
|
+
std.color.blue = 0x0079F1FF
|
|
1542
|
+
std.color.darkblue = 0x0052ACFF
|
|
1543
|
+
std.color.purple = 0xC87AFFFF
|
|
1544
|
+
std.color.violet = 0x873CBEFF
|
|
1545
|
+
std.color.darkpurple = 0x701F7EFF
|
|
1546
|
+
std.color.beige = 0xD3B083FF
|
|
1547
|
+
std.color.brown = 0x7F6A4FFF
|
|
1548
|
+
std.color.darkbrown = 0x4C3F2FFF
|
|
1549
|
+
std.color.black = 0x000000FF
|
|
1550
|
+
std.color.blank = 0x00000000
|
|
1551
|
+
std.color.magenta = 0xFF00FFFF
|
|
1582
1552
|
end
|
|
1583
1553
|
local P = {
|
|
1584
1554
|
install = install
|
|
@@ -1586,7 +1556,7 @@ install = install
|
|
|
1586
1556
|
return P
|
|
1587
1557
|
end
|
|
1588
1558
|
--
|
|
1589
|
-
|
|
1559
|
+
src_lib_object_std_55789ed51260 = function()
|
|
1590
1560
|
local P = {
|
|
1591
1561
|
milis = 0,
|
|
1592
1562
|
delta = 0,
|
|
@@ -1609,6 +1579,10 @@ font_size = function() end,
|
|
|
1609
1579
|
font_name = function() end,
|
|
1610
1580
|
font_default = function() end
|
|
1611
1581
|
},
|
|
1582
|
+
image = {
|
|
1583
|
+
load = function() end,
|
|
1584
|
+
draw = function() end
|
|
1585
|
+
},
|
|
1612
1586
|
app = {
|
|
1613
1587
|
width = 1280,
|
|
1614
1588
|
height = 720,
|
|
@@ -1648,7 +1622,7 @@ any=false
|
|
|
1648
1622
|
return P;
|
|
1649
1623
|
end
|
|
1650
1624
|
--
|
|
1651
|
-
|
|
1625
|
+
src_lib_util_pipeline_55789ed7d870 = function()
|
|
1652
1626
|
local function pipe(self)
|
|
1653
1627
|
return function()
|
|
1654
1628
|
self:run()
|
|
@@ -1698,7 +1672,7 @@ run=run
|
|
|
1698
1672
|
return P
|
|
1699
1673
|
end
|
|
1700
1674
|
--
|
|
1701
|
-
|
|
1675
|
+
src_lib_util_decorator_55789ed6a3c0 = function()
|
|
1702
1676
|
local function decorator_prefix3(zig, zag, zom, func)
|
|
1703
1677
|
return function (a, b, c, d, e, f)
|
|
1704
1678
|
return func(zig, zag, zom, a, b, c, d, e, f)
|
|
@@ -1737,18 +1711,26 @@ local y = object.offset_y + b
|
|
|
1737
1711
|
return func(x, y, c, d, e, f)
|
|
1738
1712
|
end
|
|
1739
1713
|
end
|
|
1714
|
+
local function table_prefix1(prefix, fn_table)
|
|
1715
|
+
local new_table = {}
|
|
1716
|
+
for name, fn in pairs(fn_table) do
|
|
1717
|
+
new_table[name] = decorator_prefix1(prefix, fn)
|
|
1718
|
+
end
|
|
1719
|
+
return new_table
|
|
1720
|
+
end
|
|
1740
1721
|
local P = {
|
|
1741
1722
|
offset_xy1 = decorator_offset_xy1,
|
|
1742
1723
|
offset_xy2 = decorator_offset_xy2,
|
|
1743
1724
|
offset_xyxy1 = decorator_offset_xyxy1,
|
|
1744
1725
|
prefix3 = decorator_prefix3,
|
|
1745
1726
|
prefix2 = decorator_prefix2,
|
|
1746
|
-
prefix1 = decorator_prefix1
|
|
1727
|
+
prefix1 = decorator_prefix1,
|
|
1728
|
+
prefix1_t = table_prefix1
|
|
1747
1729
|
}
|
|
1748
1730
|
return P
|
|
1749
1731
|
end
|
|
1750
1732
|
--
|
|
1751
|
-
|
|
1733
|
+
src_lib_util_http_55789eda0210 = function()
|
|
1752
1734
|
local function is_ok(status)
|
|
1753
1735
|
return (status and 200 <= status and status < 300) or false
|
|
1754
1736
|
end
|
|
@@ -1829,7 +1811,7 @@ return self
|
|
|
1829
1811
|
end
|
|
1830
1812
|
self.to_http_protocol = function ()
|
|
1831
1813
|
local index = 1
|
|
1832
|
-
local request = method..' '..uri..' HTTP/1.1\r\n'
|
|
1814
|
+
local request = method..' '..uri..' HTTP/1'..'.1\r\n'
|
|
1833
1815
|
while index <= #self.header_list do
|
|
1834
1816
|
local header = self.header_list[index]
|
|
1835
1817
|
local value = self.header_dict[header]
|
|
@@ -1897,4 +1879,4 @@ create_request=create_request
|
|
|
1897
1879
|
}
|
|
1898
1880
|
end
|
|
1899
1881
|
--
|
|
1900
|
-
return
|
|
1882
|
+
return main_55789ed4b7f0()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamely/gly-engine-lite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"author": "RodrigoDornelles",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.gamely.com.br",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"bugs": "https://github.com/gamelly/gly-engine/issues",
|
|
10
10
|
"description": "Game Engine written in 100% lua that runs in a vacuum.",
|
|
11
11
|
"main": "dist/main.lua",
|
|
12
|
+
"types": "types/main.d.ts",
|
|
12
13
|
"keywords": [
|
|
13
14
|
"game engine",
|
|
14
15
|
"game",
|
package/types/main.d.ts
ADDED