TestGUI.ls
package
{
import loom.Application;
import loom2d.display.StageScaleMode;
import loom2d.ui.SimpleLabel;
public class TestGUI extends Application
{
override public function run():void
{
stage.scaleMode = StageScaleMode.LETTERBOX;
centeredMessage(simpleLabel, this.getFullTypeName());
test();
}
private function get simpleLabel():SimpleLabel
{
return stage.addChild(new SimpleLabel("assets/Curse-hd.fnt")) as SimpleLabel;
}
private function centeredMessage(label:SimpleLabel, msg:String):void
{
label.text = msg;
label.center();
label.x = stage.stageWidth / 2;
label.y = (stage.stageHeight / 2) - (label.height / 2);
}
private function test():void
{
trace('test');
}
}
}
$ ~/.loom/sdks/sprint33/tools/lsc
$ ~/.loom/sdks/sprint33/bin/LoomDemo.app/Contents/MacOS/LoomDemo
> %userprofile%\.loom\sdks\sprint33\tools\lsc
> start "Loom" %userprofile%\.loom\sdks\sprint33\bin\LoomDemo.exe
TestCLI.build
{
"name": "TestCLI",
"version": "1.0",
"executable": true,
"outputDir": "./bin",
"references": [
"System"
],
"modules": [
{
"name": "TestCLI",
"version": "1.0",
"sourcePath": [ "." ]
}
]
}
TestCLI.ls
package
{
import system.application.ConsoleApplication;
public class TestCLI extends ConsoleApplication
{
override public function run():void
{
var arg:String;
for (var i = 0; i < CommandLine.getArgCount(); i++)
{
trace('arg', i, ':', CommandLine.getArg(i));
}
}
}
}
$ ~/.loom/sdks/sprint33/tools/lsc TestCLI.build
$ ~/.loom/sdks/sprint33/tools/loomexec bin/TestCLI.loom --optionA arg1 arg2 -b
> %userprofile%\.loom\sdks\sprint33\tools\lsc TestCLI.build
> %userprofile%\.loom\sdks\sprint33\tools\loomexec bin/TestCLI.loom --optionA arg1 arg2 -b