Skip to content

Commit 39e88df

Browse files
committed
solar2d/corona test and example in readme
1 parent 139c324 commit 39e88df

35 files changed

+329
-1
lines changed

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Note that the path to `lldebugger` will automatically be appended to the `LUA_PA
6868
---
6969
## Requirements & Limitations
7070
- The Lua environment must support communication via stdio.
71-
- Some enviroments may require command line options to support this (ex. Corona requires `/no-console` flag)
71+
- Some enviroments may require command line options to support this (ex. Solar2D requires `/no-console` flag)
7272
- Use of `io.read` or other calls that require user input will cause problems
7373
- The Lua environment must be built with the `debug` library, and no other code should attempt to set debug hooks.
7474
- You cannot manually pause debugging while the program is running.
@@ -280,6 +280,53 @@ end
280280

281281
Information on downloading dmengine for your platform can be found [here](https://forum.defold.com/t/editor-2-dmengine-versions/9605).
282282

283+
### Solar2D / Corona
284+
285+
```json
286+
{
287+
"version": "0.2.0",
288+
"configurations": [
289+
{
290+
"name": "Debug",
291+
"type": "lua-local",
292+
"request": "launch",
293+
"windows": {
294+
"program": {
295+
"command": "C:\\Program Files (x86)\\Corona Labs\\Corona\\Corona Simulator.exe",
296+
},
297+
"args": [
298+
"/no-console",
299+
"/debug",
300+
"${workspaceFolder}\\main.lua"
301+
]
302+
},
303+
"osx": {
304+
"program": {
305+
"command": "/Applications/Corona/CoronaSimulator.app/Contents/MacOS/CoronaSimulator",
306+
},
307+
"args": [
308+
"-no-console"
309+
"YES"
310+
"-debug"
311+
"1"
312+
"-project"
313+
"${workspaceFolder}/main.lua"
314+
]
315+
}
316+
}
317+
]
318+
}
319+
```
320+
321+
```lua
322+
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
323+
local lldebugger = loadfile(os.getenv("LOCAL_LUA_DEBUGGER_FILEPATH"))()
324+
lldebugger.start()
325+
end
326+
327+
...
328+
```
329+
283330
### TypescriptToLua (Custom Environment)
284331

285332
```js
@@ -302,6 +349,14 @@ Information on downloading dmengine for your platform can be found [here](https:
302349
}
303350
```
304351

352+
```lua
353+
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
354+
require("lldebugger").start()
355+
end
356+
357+
...
358+
```
359+
305360
**tsconfig.json**
306361

307362
```js

tests/solar2d/.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug",
6+
"type": "lua-local",
7+
"request": "launch",
8+
"program": {
9+
"command": "C:\\Program Files (x86)\\Corona Labs\\Corona\\Corona Simulator.exe"
10+
},
11+
"args": [
12+
"/no-console",
13+
"/debug",
14+
"${workspaceFolder}\\main.lua"
15+
],
16+
"verbose": true
17+
}
18+
]
19+
}

tests/solar2d/.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.settings": "lua",
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_launcher_background">#e2e2e2</color>
4+
</resources>

tests/solar2d/Icon.png

563 Bytes
Loading
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "20x20",
5+
"idiom" : "iphone",
6+
"filename" : "Icon-40.png",
7+
"scale" : "2x"
8+
},
9+
{
10+
"idiom" : "iphone",
11+
"size" : "20x20",
12+
"scale" : "3x"
13+
},
14+
{
15+
"size" : "29x29",
16+
"idiom" : "iphone",
17+
"filename" : "Icon-58.png",
18+
"scale" : "2x"
19+
},
20+
{
21+
"size" : "29x29",
22+
"idiom" : "iphone",
23+
"filename" : "Icon-87.png",
24+
"scale" : "3x"
25+
},
26+
{
27+
"size" : "40x40",
28+
"idiom" : "iphone",
29+
"filename" : "Icon-80.png",
30+
"scale" : "2x"
31+
},
32+
{
33+
"idiom" : "iphone",
34+
"size" : "40x40",
35+
"scale" : "3x"
36+
},
37+
{
38+
"size" : "60x60",
39+
"idiom" : "iphone",
40+
"filename" : "Icon-120.png",
41+
"scale" : "2x"
42+
},
43+
{
44+
"size" : "60x60",
45+
"idiom" : "iphone",
46+
"filename" : "Icon-180.png",
47+
"scale" : "3x"
48+
},
49+
{
50+
"idiom" : "ipad",
51+
"size" : "20x20",
52+
"scale" : "1x"
53+
},
54+
{
55+
"idiom" : "ipad",
56+
"size" : "20x20",
57+
"scale" : "2x"
58+
},
59+
{
60+
"idiom" : "ipad",
61+
"size" : "29x29",
62+
"scale" : "1x"
63+
},
64+
{
65+
"idiom" : "ipad",
66+
"size" : "29x29",
67+
"scale" : "2x"
68+
},
69+
{
70+
"idiom" : "ipad",
71+
"size" : "40x40",
72+
"scale" : "1x"
73+
},
74+
{
75+
"idiom" : "ipad",
76+
"size" : "40x40",
77+
"scale" : "2x"
78+
},
79+
{
80+
"size" : "76x76",
81+
"idiom" : "ipad",
82+
"filename" : "Icon-76.png",
83+
"scale" : "1x"
84+
},
85+
{
86+
"size" : "76x76",
87+
"idiom" : "ipad",
88+
"filename" : "Icon-152.png",
89+
"scale" : "2x"
90+
},
91+
{
92+
"size" : "83.5x83.5",
93+
"idiom" : "ipad",
94+
"filename" : "Icon-167.png",
95+
"scale" : "2x"
96+
},
97+
{
98+
"size" : "1024x1024",
99+
"idiom" : "ios-marketing",
100+
"filename" : "Icon-1024.png",
101+
"scale" : "1x"
102+
}
103+
],
104+
"info" : {
105+
"version" : 1,
106+
"author" : "xcode"
107+
}
108+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Binary file not shown.
258 Bytes
Binary file not shown.
Binary file not shown.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10+
</dependencies>
11+
<scenes>
12+
<!--View Controller-->
13+
<scene sceneID="EHf-IW-A2E">
14+
<objects>
15+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
16+
<layoutGuides>
17+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
18+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
19+
</layoutGuides>
20+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
22+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23+
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
24+
</view>
25+
</viewController>
26+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
27+
</objects>
28+
<point key="canvasLocation" x="53" y="375"/>
29+
</scene>
30+
</scenes>
31+
</document>

tests/solar2d/build.settings

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
--
2+
-- For more information on build.settings, see the Project Build Settings guide at:
3+
-- https://docs.coronalabs.com/guide/distribution/buildSettings
4+
--
5+
6+
settings =
7+
{
8+
orientation =
9+
{
10+
-- Supported values for orientation:
11+
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight
12+
default = "landscapeRight",
13+
supported = { "landscapeRight", },
14+
},
15+
16+
--
17+
-- Android section
18+
--
19+
android =
20+
{
21+
usesPermissions =
22+
{
23+
"android.permission.INTERNET",
24+
},
25+
},
26+
27+
--
28+
-- iOS section
29+
--
30+
iphone =
31+
{
32+
xcassets = "Images.xcassets",
33+
plist =
34+
{
35+
UIStatusBarHidden = false,
36+
UILaunchStoryboardName = "LaunchScreen",
37+
},
38+
},
39+
40+
--
41+
-- Plugins section
42+
--
43+
plugins =
44+
{
45+
46+
},
47+
48+
--
49+
-- Project section
50+
--
51+
excludeFiles =
52+
{
53+
-- Exclude unnecessary files for each platform
54+
all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
55+
android = { "LaunchScreen.storyboardc", },
56+
},
57+
}

tests/solar2d/config.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--
2+
-- For more information on config.lua see the Project Configuration Guide at:
3+
-- https://docs.coronalabs.com/guide/basics/configSettings
4+
--
5+
6+
application =
7+
{
8+
content =
9+
{
10+
width = 320,
11+
height = 480,
12+
scale = "letterbox",
13+
fps = 60,
14+
15+
--[[
16+
imageSuffix =
17+
{
18+
["@2x"] = 2,
19+
["@4x"] = 4,
20+
},
21+
--]]
22+
},
23+
}

tests/solar2d/main.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-----------------------------------------------------------------------------------------
2+
--
3+
-- main.lua
4+
--
5+
-----------------------------------------------------------------------------------------
6+
7+
-- Your code here
8+
9+
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
10+
local lldebugger = loadfile(os.getenv("LOCAL_LUA_DEBUGGER_FILEPATH"))()
11+
lldebugger.start()
12+
end
13+
14+
local msgText = display.newText("Hello, world!", 250, 250, native.systemFont, 32)
15+
msgText:setFillColor(0.2, 0.6, 0.8)

0 commit comments

Comments
 (0)