• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created about 11 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Corona Editor is the official Corona SDK plugin for Sublime Text

Solar2D Editor

Solar2D Editor (rebranded Corona Editor) is the official Solar2D plugin for Sublime Text. Designed to make building apps even easier by adding functionality to Sublime Text to improve developer productivity.

Sublime Text Version

Sublime Text 3 is required to use Solar2D Editor.

Installation Instructions

  1. Install the Sublime Text Package Control plugin if you don't already have it using Tools > Command Palette... > Install Package Control
  2. When that's installed, in Sublime Text choose: Tools > Command Palette... > Package Control: Install Package
  3. Find Corona Editor by typing in the search field, click on it to install it
  4. Restart Sublime Text to see the new features

If you want to help test the latest development version of Solar2D Editor you can configure Package Control to grab it instead of the official release version by following these steps:

  1. In Sublime Text choose: Tools > Command Palette... > Package Control: Remove Package and uninstall any installed version of Corona Editor
  2. Choose: Tools > Command Palette... > Package Control: Add Repository
  3. Enter https://github.com/coronalabs/CoronaSDK-SublimeText
  4. Choose: Tools > Command Palette... > Package Control: Install Package
  5. Find CoronaSDK-SublimeText (or, on some machines, Corona Editor - Daily Build) by typing in the search field, click on it to install it
  6. Restart Sublime Text or reopen any .lua files to see the new features

Alternatively, if you are comfortable doing manual installs of Sublime Text plugins and want to run the latest development version, you can download the plugin from https://github.com/coronalabs/CoronaSDK-SublimeText/archive/master.zip

If you install the tip from Github please report any issues using the Issues page on Github: https://github.com/coronalabs/CoronaSDK-SublimeText/issues

Using the Plugin

After restarting Sublime Text you'll have several new features available in the Solar2D Editor menu and in the context menu when editing Solar2D .lua files. Most of the features of the plugin rely on the current Syntax setting so when editing files you should use View > Syntax > Lua (Solar2D) command to set the correct syntax for the file. You will probably also want to change Sublime Text's default for .lua files by choosing View > Syntax > Open all with current extension as... > Lua (Solar2D) when you have a .lua file open in the editor.

If the syntax option is set correctly you'll see it displayed in the bottom righthand corner of the Sublime Text window.

There are several Sublime Text User Preferences that can be set to fine tune the behavior of the plugin. You can find information on setting User Preferences here http://www.sublimetext.com/docs/3/settings.html.

Debugger

Debugger allows code to be single stepped, variables to be examined and breakpoints to be set. You can run the debugger using the Solar2D Editor menu from any file in the project and it will automatically find main.lua. Right click on a code line in the editor and choose Toggle Breakpoint to turn a breakpoint on or off. Select the name of a variable and choose Inspect Variable from the context menu to see its value.

The following keys also control the Debugger:

Key Action
F10 Run Project in the Debugger or continue project execution
Shift+F10 Stop debugger
Super+F10 Run Project
F11 Step over
Shift+F11 Step into

A simpler alternative to the Build command in Sublime Text is the Run Project command in the Solar2D Editor menu (or Super+F10). It doesn't have all the bells and whistles of the build system but it is quick and easy. It is also better at finding your project's main.lua if you aren't using Sublime Text's projects. Super+B (usually bound to the Build command) is now bound to the Run Project command for Solar2D Lua files.

On macOS, if you install Solar2D in /Applications without changing the default name, it will use the highest numbered (most recent) build to run the project (to change this behavior, see corona_sdk_simulator_path below).

Preferences
  • corona_sdk_simulator_path (default: system dependent)

    Set this to the path of your Solar2D Simulator if it's not installed in the default location for your operating system (remember to double the backslashes in Windows paths). You can also set this in the build.settings file of individual projects to customize the version of the Solar2D Simulator that is used for each project (note that the Lua syntax for the build.settings file is different to the JSON syntax of the Sublime Text preference files in that the name of the preference is not quoted in Lua).

  • corona_sdk_simulator_show_console (default: false)

    Set this to true to have the Solar2D Simulator Console be shown when running a project with Super+F10 (or Super+B).

Current Gotchas
  • If you Run the project and it doesn't hit a breakpoint, you'll have to stop and restart to regain control (in particular, setting a breakpoint on a line of code you know is being executed wont stop the program).
  • Single stepping through "internal locations" is tedious.
  • There's an implicit breakpoint set on the first line of main.lua so to hit your own first breakpoint you need to run once to start the debugger and stop on the first line then run again to continue until you hit your own breakpoint.
  • If you create rows and columns in using Sublime Text's View > Layout command in the current tab, the debugger wont create its own panes and its functionality will be reduced.

Completion

Completion works for all API calls and constants (correctly handling periods in the name). Fuzzy matching is optionally done to increase the chances of finding the item you are looking for. Completion relies on the current Syntax setting so when creating new files you should use View > Syntax > Lua (Solar2D) command to set the correct syntax for the new file. You will probably also want to change Sublime Text's default for .lua files by choosing View > Syntax > Open all with current extension as... > Lua (Solar2D) when you have a .lua file open in the editor.

Preferences
  • corona_sdk_completion (default: True)

    If you don't like Solar2D Editor's completion you can turn it off entirely using this preference.

  • corona_sdk_use_fuzzy_completion (default: True)

    Turn off "fuzzy completion" and just complete based on the characters typed so far as a prefix.

  • corona_sdk_complete_periods (default: True)

    Solar2D Editor turns off the special meaning of periods as "word separators" in Sublime Text to make Solar2D completions work better. If you like to use cursor movement keys like "Alt+Arrow" to move to the periods in function calls you might want to turn this off. The most obvious effect of turning it off is that when you type a period all the completions disappear until you type another character.

  • corona_sdk_use_docset (default: public)

    Choose which completion set you want to use. Can be one of public (the default), legacy(deprecated) or daily(deprecated).

  • corona_completions_strip_white_space (default: False)

    Set to true if you want items to be completed with minimal whitespace included.

Current Gotchas
  • The order of items in the completions popup seems a little odd but is due to Sublime Text's "fuzzy" matching

  • Some of the completions may have minor errors with nested optional parameters due to the way they are automatically generated.

Documentation Lookup

Documentation can be called up by placing the cursor on an API call (or selecting it) and either hitting F1 or choosing Solar2D Docs from the context menu. Lua keywords will be looked up in the Lua documentation. If the context of something isn't recognized, a search of the Solar2D documentation will be initiated.

Current Gotchas
  • Note that right clicking on an item wont move the cursor there so you can't right click on a term that's not at the insertion point and then pick Solar2D Docs from the context menu as it's the position of the text cursor that determines what's looked up (left click on the item first)

Snippets

A selection of commonly used code fragments and templates is available via the Solar2D Editor > Snippets menu. Selecting an item from a submenu will insert its code at the current insertion point in the file.

A default set of snippets is created in the Sublime Text support folder Packages/User/Corona Editor/Snippets. You can create your own folders and files to add to the default set. Files should either be Sublime Text .sublime-snippet files or plain text files. The contents of plain text files are just inserted when chosen unless they exactly match a completion entry in which case the completion is looked up and they work like a normal completion (you can tab between the arguments) which provides a way to make menus of hard to remember API calls.

Build System

The Run Project command in the Solar2D Editor menu (or Super+B or Super+F10) is a simpler alternative to the Build command in Sublime Text (see above for more information).

Syntax Highlighting

Syntax highlighting of Lua with Solar2D calls is done (choose View > Syntax > Lua (Solar2D) to enable this). You will probably also want to change Sublime Text's default for .lua files by choosing View > Syntax > Open all with current extension as... > Lua (Solar2D) when you have a .lua file open in the editor.

Miscellaneous

  • A shortcut to the Sublime Text Goto Anything... function list has been added to the context menu as Function Navigator.... This lists the functions defined in the current file and choosing one takes you to that definition.
  • The Solar2D Editor menu has a Show/Hide Build Panel command to toggle the visibility of the Build Results panel (which displays the output of the Simulator). Note that hiding the panel clears its contents.

Reporting Issues

You can find discussion about Solar2D Editor on the forums.

If some aspect of the plugin doesn't behave as expected be sure to include any console output when reporting the problem. You can view the console using View > Show Console and copy and paste the information displayed there.

Known Issues

  • Syntax highlighting is incorrect for function definitions that look like:
local back=simplebutton.create("Back",function() menumanager.openMenu("main") end)

Platform Specific Advice

Mac

You may want to set the Use all F1, F2, etc. keys as standard function keys option in System Preferences > Keyboard to make using F10 and F11 easier for the debugger. Alternatively you may want to reassign the keys used to drive the debugger; information on how to this can be found at http://www.sublimetext.com/docs/key-bindings

Thanks

Many thanks to the Solar2D users who have provided feedback and suggestions to make Solar2D Editor even better. Particular thanks to personalnadir, develephant, givemeyourgits and landoncope for their contributions and help.

More Repositories

1

corona

Solar2D Game Engine main repository (ex Corona SDK)
C++
2,197
star
2

samples-coronasdk

Sample code for Corona SDK.
Lua
61
star
3

framework-widget

Corona widget.* framework
Lua
43
star
4

CoronaCrush

Lua
36
star
5

Sticker-Knight-Platformer

Lua
34
star
6

CoronaViewer

CoronaViewer for SDK/Enterprise
Lua
24
star
7

Match-Three-Space-RPG

Lua
22
star
8

Endless-Skateborder

Full app sample of an endless runner style game
Lua
22
star
9

corona-docs

Corona documentation, source for https://docs.coronalabs.com/
HTML
21
star
10

framework-storyboard-legacy

The legacy storyboard framework
Lua
12
star
11

framework-cloud

The Core LUA Library for Corona Cloud
Lua
11
star
12

widget-v1

Widget v1.0 source. Use with caution!
Lua
11
star
13

plugins-source

This is the list of open source plugin projects available for Corona SDK and CoronaEnterprise.
10
star
14

framework-sprite-legacy

Lua
9
star
15

camerafill-samples

Lua
8
star
16

CoronaSDK-AtomPlugin

CoffeeScript
7
star
17

GettingStarted01

Assets for chapter 1 of the getting started guide.
Lua
7
star
18

submodule-platform-linux

Linux platform implementation. This is submodule of Corona repository.
C
6
star
19

corona-cloud-core

The low-level layer LUA library for Corona Cloud
Lua
6
star
20

launchimage

Create a Storyboard based launch image for iOS 8
Swift
6
star
21

plugins-template-library-lua

Lua
5
star
22

framework-transition

Corona transition.* library
Lua
5
star
23

plugins-source-google-iap-v3

This plugin allows you to support in-app purchases using Google's in-app billing service.
Java
5
star
24

plugins-sample-openssl

Corona SDK sample code for the OpenSSL plugin
Lua
4
star
25

steamworks-sample

Sample app showing how to use the Steamworks plugin
Lua
4
star
26

framework-animation

Corona Animation Framework
Lua
4
star
27

plugins-source-native-popup-social

The social plugin enables you to post a message to various social providers.
Java
4
star
28

plugins-sample-memoryBitmap

Memory Bitmap Plugin. Simple demo of TextureResourceExternal and cross platform C plugins.
C++
3
star
29

framework-composer

Corona composer.* framework
Lua
3
star
30

corona-docs-plugins

This is repo was a module but now files are moved to main repo https://github.com/coronalabs/corona-docs
3
star
31

plugins-sample-appodeal

Lua
3
star
32

framework-timer

Corona timer.* library
Lua
3
star
33

sample-widget-panel

Sample code demonstrating extending the widget framework to create a panel.
Lua
3
star
34

submodule-native

Samples and template for Corona Native. This is submodule of Corona repository.
Kotlin
3
star
35

GridLayout

Project files that go with the Grid Layout tutorial
Lua
2
star
36

PewPew

Lua
2
star
37

plugins-appodeal

Source code for all the appodeal plugins
Objective-C
2
star
38

com.coronalabs-plugin.bit

Rpository for plugin.bit.
C
2
star
39

com.coronalabs-plugin.admob

Rpository for plugin.admob.
Objective-C
2
star
40

plugins-sample-admob

Lua
2
star
41

plugins-lua-template

This is a plugin project for pure Lua-based implementations (no native code)
2
star
42

plugins-source-facebook

The facebook plugin provides access to Facebook Connect, a set of APIs for accessing the Facebook social network. The functions allow a user to login/logout, post messages and images, and retrieve status.
Lua
2
star
43

plugins-source-notifications

Gives access to local and push notifications.
Objective-C++
2
star
44

submodule-welcomescreen

This is welcome screen shown when starting Corona. This is submodule of Corona repository.
Lua
2
star
45

plugins-template-library-docs

2
star
46

plugins-source-gamenetwork-google

Google Play Game Services makes your games more social with capabilities for achievements, leaderboards, and other popular features using the Google Play game services SDK. Let players sign in using their Google+ identities and share their gaming experience with friends.
Java
2
star
47

sample-webgl-demo

Lua
2
star
48

plugins-source-native-popup-activity

The Activity plugin displays the activity popup window which corresponds to UIActivityViewController on iOS.
Objective-C++
2
star
49

GettingStarted08

Code and assets for the Getting Started Guide final chapter.
Lua
1
star
50

com.coronalabs-plugin.kochava

Rpository for plugin.kochava.
Objective-C
1
star
51

plugins-sample-fbAudienceNetwork

Lua
1
star
52

plugins-source-openssl

The OpenSSL plugin provides access to the OpenSSL library as exposed by George Zhao's lua-openssl.
C
1
star
53

com.coronalabs-plugin.appodeal.MillenialMedia

Rpository for plugin.appodeal.MillenialMedia.
Lua
1
star
54

plugins-sample-googleAnalytics

Lua
1
star
55

com.coronalabs-plugin.appodeal.beta.MillenialMedia

Rpository for plugin.appodeal.beta.MillenialMedia.
Lua
1
star
56

com.coronalabs-plugin.nanosvg

Rpository for plugin.nanosvg.
C
1
star
57

com.coronalabs-CoronaProvider.native.popup.safariView

Rpository for CoronaProvider.native.popup.safariView.
Lua
1
star
58

plugins-source-zip

The Zip plugin enables basic zip archive support.
C
1
star
59

com.coronalabs-plugin.gpgs

Rpository for plugin.gpgs.
Lua
1
star
60

plugins-sample-flurry-analytics

Lua
1
star
61

plugins-source-facebook-v4a

Source code for Facebook Plugin
Objective-C
1
star
62

sample-textureLoad

This repository contain TextureLoad sample + Images to load.
Lua
1
star
63

com.coronalabs-plugin.batteryState

Rpository for plugin.batteryState.
Kotlin
1
star
64

plugins-template-shader-lua

Batchfile
1
star
65

plugins-source-itunes

The iTunes plugin enables you to access the user's iTunes library and play media from it.
Objective-C++
1
star
66

js_plugin

Example HTML5 JavaScript plugin
Lua
1
star
67

com.coronalabs-plugin.CoronaSplashControl

Rpository for plugin.CoronaSplashControl.
1
star
68

tutorial-moving-objects

Project for the Moving Objects tutorial at: http://coronalabs.com/blog/2014/01/07/tutorial-moving-objects-along-a-path/
Lua
1
star
69

submodule-plugins-gameNetwork

Deprecated. This is submodule of Corona repository.
Lua
1
star
70

demo-emitter-absolutePosition

Quick demo for different absolutePosition modes of EmitterObject
Lua
1
star
71

com.coronalabs-shared.google.play.services.games

Rpository for shared.google.play.services.games.
Lua
1
star
72

plugins-sample-gamenetwork-apple

Lua
1
star
73

com.coronalabs-shared.google.play.services.ads

Rpository for shared.google.play.services.ads.
Lua
1
star
74

submodule-plugins-licensing

This is submodule of Corona repository.
Shell
1
star
75

sample-customFilter

Lua
1
star
76

com.coronalabs-shared.android.support.v7.cardview

Rpository for shared.android.support.v7.cardview.
Lua
1
star
77

framework-easing

Corona easing.* library
Lua
1
star
78

submodule-plugins-build-core

Pre-build build-in plugins for Corona templates. This is submodule of Corona repository.
1
star
79

com.coronalabs-plugin.memoryBitmap

Rpository for plugin.memoryBitmap.
C++
1
star
80

submodule-box2d

This is submodule external/Box2D of Corona repository.
C++
1
star
81

plugins-source-gamenetwork-apple

Game Center lets friends in on the action with leaderboards and achievements. The nomenclature used in the Corona APIs for Game Center attempt to match the official Game Center APIs as much as possible, allowing you to cross-reference with official Game Center documentation.
Objective-C++
1
star
82

submodule-mojoAL

This is submodule of Corona repository.
C
1
star
83

com.coronalabs-plugin.appodeal.base

Rpository for plugin.appodeal.base.
Objective-C
1
star
84

com.coronalabs-plugin.iCloud

Rpository for plugin.iCloud.
Objective-C++
1
star