Difference between revisions of "Sublime Text"
Line 31: | Line 31: | ||
Now you can use CMD + B to run your love project. | 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: | ||
+ | <source lang="lua"> | ||
+ | io.stdout:setvbuf("no") | ||
+ | </source> | ||
== See also == | == See also == | ||
* [http://www.sublimetext.com/2 Sublime Text 2 Website] | * [http://www.sublimetext.com/2 Sublime Text 2 Website] | ||
* [http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/reference/build_systems.html Sublime Text 2 Build Systems] | * [http://sublime-text-unofficial-documentation.readthedocs.org/en/latest/reference/build_systems.html Sublime Text 2 Build Systems] | ||
+ | * [http://stackoverflow.com/questions/16338523/live-console-output-in-sublime-text-2 Stack Overflow question about console output in Sublime Text 2] | ||
[[Category:Software]] | [[Category:Software]] |
Revision as of 11:51, 13 June 2013
Sublime Text is a sophisticated text editor for code, markup and prose.
Contents
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": ["love", "$file_path"]
}
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:
io.stdout:setvbuf("no")
See also
- Sublime Text 2 Website
- Sublime Text 2 Build Systems
- Stack Overflow question about console output in Sublime Text 2