This guide will help you get up and running with Solar2D for Windows.
You do not need to install the Android SDK to use Solar2D. However, to create device builds to test on actual Android devices, you will need the Java Development Kit. The installation process is described below.
We'll assume you've already downloaded Solar2D. Now, double click the .msi
installer file and follow the steps in the installation wizard.
Installing JDK is no longer required for Solar2D 2020.3629 and later.
Installing Solar2D lets you create and test apps locally on your PC. If you intend to build apps for testing on Android devices, you will need to install the
jdk-8u261-windows-i586.exe
You'll need a text editor or IDE to write code for your Solar2D projects. If you don't already have a favorite text editor, the following options are recommended:
Editor | Add-On Package |
---|---|
Sublime Text | Solar2D Editor |
Visual Studio Code | Solar2D-companion |
Notepad++ | |
ZeroBrane Studio | |
Vim |
The Solar2D development environment consists of two aspects: the Solar2D Simulator and the Solar2D Console window.
The Solar2D Simulator is a visual representation and test environment for your app. What you see in the Simulator is generally what your app will look like — and how it will function — when deployed to an actual device. Solar2D Simulator is an essential tool because it allows you to view changes to your code instantly in an active, responsive environment that closely mimics the device.
The Solar2D Simulator Console is where you can view diagnostic messages about what's happening in your program. This window is automatically displayed when you launch the Solar2D Simulator.
The Solar2D Simulator for Windows features the following basic menu items:
The File menu is where projects (applications) are created or opened. This is also where you build your apps for distribution or testing on devices. Finally, this menu provides access to the Simulator Preferences.
The Hardware menu is used to simulate physical device actions such as rotating the screen.
The View menu lets you open the Welcome Screen which provides quick access to recent projects, Solar2D developer resources, and more. This menu also lets you access the Solar2D Simulator Console (Console). Finally, this menu includes options to manipulate the Simulator window or change the skin
To start a particular app in the Solar2D Simulator without double-clicking it, use a command like this:
"C:\Program Files\Corona Labs\Corona\Corona Simulator.exe" "C:\Documents and Settings\MyAccount\My Documents\Corona Apps\My App\main.lua"
If you don't want the Solar2D Simulator Console window to automatically appear, use the /no-console
option:
"C:\Program Files\Corona Labs\Corona\Corona Simulator.exe" /no-console
After using the /no-console
option above, all Lua print()
functions and Solar2D log messages can be received via the standard output stream (stdout
).
One additional flag is allowed (/debug
) which allows an IDE to connect a debugger to the Simulator session. It should come immediately after the .exe
.
If you're new to Solar2D, the most fun way to learn is to create a simple game. Don't worry if you've never created a mobile app or programmed before — the chapters in the guide will walk you through the entire process from start to finish!