@gamely/gly-engine-nano 0.1.5 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/main.lua +34 -32
  2. package/package.json +2 -2
package/dist/main.lua CHANGED
@@ -1,19 +1,19 @@
1
- local source_version_c2b = nil
2
- local source_engine_api_system_key_c3d = nil
3
- local source_engine_api_draw_text_c48 = nil
4
- local source_engine_api_draw_poly_c53 = nil
5
- local source_engine_api_system_color_c65 = nil
6
- local source_shared_var_object_std_c70 = nil
7
- local source_shared_string_eval_code_c82 = nil
8
- local source_shared_functional_decorator_10a6 = nil
9
- local function main_c22()
10
- local version = source_version_c2b()
11
- local engine_key = source_engine_api_system_key_c3d()
12
- local engine_api_draw_text = source_engine_api_draw_text_c48()
13
- local engine_api_draw_poly = source_engine_api_draw_poly_c53()
14
- local color = source_engine_api_system_color_c65()
15
- local std = source_shared_var_object_std_c70()
16
- local eval_code = source_shared_string_eval_code_c82()
1
+ local source_version_c17 = nil
2
+ local source_engine_api_system_key_c29 = nil
3
+ local source_engine_api_draw_text_c34 = nil
4
+ local source_engine_api_draw_poly_c3f = nil
5
+ local source_engine_api_system_color_c51 = nil
6
+ local source_shared_var_object_std_c5c = nil
7
+ local source_shared_string_eval_code_c6e = nil
8
+ local source_shared_functional_decorator_10a0 = nil
9
+ local function main_c0e()
10
+ local version = source_version_c17()
11
+ local engine_key = source_engine_api_system_key_c29()
12
+ local engine_api_draw_text = source_engine_api_draw_text_c34()
13
+ local engine_api_draw_poly = source_engine_api_draw_poly_c3f()
14
+ local color = source_engine_api_system_color_c51()
15
+ local std = source_shared_var_object_std_c5c()
16
+ local eval_code = source_shared_string_eval_code_c6e()
17
17
  local f=function(a,b)end
18
18
  local engine={keyboard=f}
19
19
  local application={
@@ -42,11 +42,11 @@ font_previous=native_text_font_previous
42
42
  }
43
43
  function native_callback_loop(dt)
44
44
  std.milis, std.delta=std.milis + dt, dt
45
- application.callbacks.loop(std, application.data)
45
+ application.callbacks.loop(application.data, std)
46
46
  end
47
47
  function native_callback_draw()
48
48
  native_draw_start()
49
- application.callbacks.draw(std, application.data)
49
+ application.callbacks.draw(application.data, std)
50
50
  native_draw_flush()
51
51
  end
52
52
  function native_callback_resize(width, height)
@@ -76,10 +76,12 @@ script.config=application.config
76
76
  application=script
77
77
  std.draw.color=native_draw_color
78
78
  std.draw.font=native_draw_font
79
+ std.draw.rect2=native_draw_rect2 or native_draw_rect
79
80
  std.draw.rect=native_draw_rect
80
81
  std.draw.line=native_draw_line
81
82
  std.image.load=native_image_load
82
83
  std.image.draw=native_image_draw
84
+ std.image.mensure=native_image_mensure
83
85
  std.text.print=native_text_print
84
86
  std.text.mensure=native_text_mensure
85
87
  std.text.font_size=native_text_font_size
@@ -89,8 +91,8 @@ std.draw.clear=function(tint)
89
91
  native_draw_clear(tint, 0, 0, application.data.width, application.data.height)
90
92
  end
91
93
  std.app.reset = function()
92
- (application.callbacks.exit or function() end)(std, application.data)
93
- application.callbacks.init(std, application.data)
94
+ (application.callbacks.exit or function() end)(application.data, std)
95
+ application.callbacks.init(application.data, std)
94
96
  end
95
97
  engine.root=application
96
98
  color.install(std, engine)
@@ -98,7 +100,7 @@ engine_key.install(std, engine, {})
98
100
  engine_api_draw_text.install(std, engine, cfg_text)
99
101
  engine_api_draw_poly.install(std, engine, cfg_poly)
100
102
  engine.current=application
101
- application.callbacks.init(std, application.data)
103
+ application.callbacks.init(application.data, std)
102
104
  end
103
105
  local P={
104
106
  meta={
@@ -110,11 +112,11 @@ version=version
110
112
  }
111
113
  return P
112
114
  end
113
- source_version_c2b = function()
114
- return '0.1.5'
115
+ source_version_c17 = function()
116
+ return '0.2.2'
115
117
  end
116
118
  --
117
- source_engine_api_system_key_c3d = function()
119
+ source_engine_api_system_key_c29 = function()
118
120
  local function real_key(std, engine, rkey, rvalue)
119
121
  local value = rvalue == 1 or rvalue == true
120
122
  local key = engine.key_bindings[rkey] or (std.key.axis[rkey] and rkey)
@@ -151,8 +153,8 @@ install = install
151
153
  return P
152
154
  end
153
155
  --
154
- source_engine_api_draw_text_c48 = function()
155
- local util_decorator = source_shared_functional_decorator_10a6()
156
+ source_engine_api_draw_text_c34 = function()
157
+ local util_decorator = source_shared_functional_decorator_10a0()
156
158
  local function text_put(std, engine, font_previous, pos_x, pos_y, text, size)
157
159
  size = size or 2
158
160
  local hem = engine.current.data.width / 80
@@ -181,7 +183,7 @@ install=install
181
183
  return P
182
184
  end
183
185
  --
184
- source_engine_api_draw_poly_c53 = function()
186
+ source_engine_api_draw_poly_c3f = function()
185
187
  local function decorator_poo(object, func)
186
188
  if not object or not func then return func end
187
189
  return function(a, b, c, d)
@@ -288,7 +290,7 @@ install=install
288
290
  return P
289
291
  end
290
292
  --
291
- source_engine_api_system_color_c65 = function()
293
+ source_engine_api_system_color_c51 = function()
292
294
  local function install(std)
293
295
  std.color = std.color or {}
294
296
  std.color.white = 0xFFFFFFFF
@@ -323,7 +325,7 @@ install = install
323
325
  return P
324
326
  end
325
327
  --
326
- source_shared_var_object_std_c70 = function()
328
+ source_shared_var_object_std_c5c = function()
327
329
  local P = {
328
330
  milis = 0,
329
331
  delta = 0,
@@ -391,7 +393,7 @@ any=false
391
393
  return P;
392
394
  end
393
395
  --
394
- source_shared_string_eval_code_c82 = function()
396
+ source_shared_string_eval_code_c6e = function()
395
397
  local function script(src)
396
398
  local loader = loadstring or load
397
399
  if not loader then
@@ -412,7 +414,7 @@ script = script,
412
414
  return P
413
415
  end
414
416
  --
415
- source_shared_functional_decorator_10a6 = function()
417
+ source_shared_functional_decorator_10a0 = function()
416
418
  local function decorator_prefix3(zig, zag, zom, func)
417
419
  return function (a, b, c, d, e, f)
418
420
  return func(zig, zag, zom, a, b, c, d, e, f)
@@ -470,4 +472,4 @@ prefix1_t = table_prefix1
470
472
  return P
471
473
  end
472
474
  --
473
- return main_c22()
475
+ return main_c0e()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamely/gly-engine-nano",
3
- "version": "0.1.5",
3
+ "version": "0.2.2",
4
4
  "author": "RodrigoDornelles",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.gamely.com.br",
@@ -18,7 +18,7 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "step1": "cd ../.. && rm -Rf dist && mkdir -p ./dist/types",
21
- "step2": "cd ../.. && node cli.js build --core nano --bundler --outdir dist/dist",
21
+ "step2": "cd ../.. && node cli.js build-engine @nano --bundler --outdir dist/dist",
22
22
  "step3": "cd ../.. && node cli.js meta source/cli/main.lua --infile npm/gly-engine-nano/package.json --outfile dist/package.json",
23
23
  "step4": "cd ../.. && echo \"declare module '@gamely/gly-engine-nano' {\n const content: string;\n export default content;\n}\" > dist/types/main.d.ts",
24
24
  "build": "npm run step1 && npm run step2 && npm run step3 && npm run step4"