Difference between revisions of "Sublime Text"

m (Hopefully fixed the path to love.exe for the build script)
(People have been having trouble getting the previous code here to work, so hopefully this works for everyone.)
Line 10: Line 10:
 
{
 
{
 
     "selector": "source.lua",
 
     "selector": "source.lua",
     "cmd": ["\"C:/Program Files/LOVE/love.exe\"", "$file_path"],
+
     "cmd": ["C:/Program Files/LOVE/love.exe", "$file_path"],
 
     "shell": true
 
     "shell": true
 
}
 
}

Revision as of 01:12, 24 April 2014

Sublime Text is a sophisticated text editor for code, markup and prose.

Running love projects from Sublime Text 2

On Windows

Create a new Build System first: Tools -> Build System -> New Build System

Then paste the following code:

{
    "selector": "source.lua",
    "cmd": ["C:/Program Files/LOVE/love.exe", "$file_path"],
    "shell": true
}

Now you can use CTRL + B to run your love project.

On Mac

Create a new Build System first: Tools -> Build System -> New Build System

Then paste in the following code:

{
    "selector": "source.lua",
    "cmd": ["/Applications/love.app/Contents/MacOS/love", "$file_path"]
}

(This is assuming that your love.app is in the Applications folder)

Now you can use CMD + B to run your love project.


Displaying live console output in Sublime Text 2

By default the console in Sublime Text will not display any output, such as print() calls, until the LOVE application has been closed.

To make the console output display live add the following code to the top of your main.lua file, or inside conf.lua:

io.stdout:setvbuf("no")

See also