(For more resources related to this topic, see here.)
Gideros is a set of software packages created and managed by a company named Gideros Mobile. It provides developers with the ability to create 2D games for multiple platforms by reusing the same code. Games created with Gideros run as native applications, thus having all the benefits of high performance and the utilization of the hardware power of a mobile device.
Gideros uses Lua as its programming language, which is a lightweight scripting language with an easy learning curve and it is quite popular in the context of game development.
A few of the greatest Gideros features are as follows:
- Its rapid prototyping and fast development time by providing a single-click on-device testing that enables you to compile and run your game from your computer to device in an instant
- A clean object-oriented approach that enables you to write clean and reusable code
- Additionally, Gideros is not limited to its provided API and can be extended to offer virtually any native platform features through its plugin system
- You can use all of these to create and even publish your game for free, if you don't mind a small Gideros splash screen being shown before your game starts
Currently, Gideros has no registration requirements for downloading its SDK, so you can easily navigate to their download page (http://giderosmobile.com/download) and download the version that is suitable for your operating system. As Gideros can be used on Linux only using the WINE emulator, it means that even for Linux you have to download the Windows version of Gideros.
So, to sum it up:
- Download the Windows version for Windows and Linux OS
- Download the Mac version for OS X
Gideros consists of multiple programs providing you with a basic package needed to develop your own mobile games.
This software package includes the following features:
- Gideros Studio: It is a lightweight IDE to manage Gideros projects
- Gideros Player: It is a fast and lightweight desktop; iOS and Android players can run their apps with one click when testing
- Gideros Texture Packer: It is used to pack multiple textures in one texture for faster texture rendering
- Gideros Font Creator: It is used to create Bitmap fonts from different font formats for faster font rendering
- Gideros License Manager: It is used to license your downloaded copy of Gideros before exporting a project (required even for free accounts)
- An offline copy of the Gideros documentation and Reference API to get you started
Creating your first project
After you have downloaded and installed Gideros, you can try to create your first Gideros project. Although Gideros is IDE independent, and lot of other IDE's such as Lua Glider, Zero Brane, IntelliJ IDEA, and even Sublime can support Gideros, I would recommend that first-time users choose the provided Gideros Studio. That is what we will be using in this article.
Trying out Gideros Studio
You should note that I will be using the Windows version for screenshots and explanations, but Gideros Studio on other operating systems is quite similar, if not exactly the same. Therefore, it should not cause any confusion if you are using other versions of Gideros.
When you open Gideros Studio, you will see a lot of different sections or what we will call panes. The largest pane will be the Start Page, which will provide you with the following options:
- Create New Project
- Access offline the Getting Started guide
- Access offline the Reference Manual
- Browse and try out Gideros Example Projects
Go ahead and click on Create New Project, a New Project dialog will open.
Now enter the name of your project, for example, New Project. Change the location of the project if you want to or leave it set to the default value, and click on OK when you are ready.
Note that the Start Page is automatically closed and the space occupied by the Start Page is now free. This will be your coding pane, where all the code will be displayed.
But first let's draw our attention to the Project pane, where you can see your chosen project name inside. In this pane, you will manage all the files used by your app.
One important thing to note is that file/folder structure in Gideros Project pane is completely independent from your filesystem. This means that you will have to add files manually to the Gideros Studio Project pane. They won't show up automatically when you copy them into the project folder.
And in your filesystem, files and folders may be organized completely different than those in Gideros Studio.
This feature gives you the flexibility of managing multiple projects with the same code or asset base. When you, for example, want to include specific things in the iOS version of the game, which Android won't have, you can create two different projects in the same project directory, which could reuse the same files and simultaneously have their own independent, platform-specific files.
So let's see how it actually works. Right-click on your project name inside the Project pane and select Add New File.... It will pop up the Add New File dialog.
Like in many Lua development environments, an application should start with a main.lua file; so name your file main.lua and click on OK. You will now see that main.lua was added to your Project pane. And if you check the directory of your project in your filesystem, you will see that it also contains the main.lua file.
Now double-click on main.lua inside the Project pane and it will open this file inside the code pane, where you can write a code for it.
So let's try it out. Write a simple line of code:
What this line will do is simply print out the provided string (Hello world!) inside the output console.
Now save the project by either using the File menu or a diskette icon on the toolbar and let's run this project on a local desktop player.
Using the Gideros desktop player
To run our app, we first need to launch Gideros Player by clicking on a small joystick icon on the toolbar.
This will open up the Gideros desktop player. The default screen of Gideros Player shows the current version of Gideros used and the IP address the player is bound to.
Additionally, the desktop player provides different customizations:
- You can make it appear on the top of every window by navigating to View | Always on Top.
- You can change the zoom by navigating to View | Zoom. It is helpful when running the player in high resolutions, which might not fit the screen.
- You can select the orientation (portrait or landscape) of the player by navigating to Hardware | Orientation, to suit the needs of your app.
- You can provide the resolution you want to test your app in by navigating to Hardware | Resolution. It provides the most popular resolution templates to choose from.
- You can also set the frame rate of your app by navigating to Hardware | Frame Rate.
Resolution selected in Gideros Player settings corresponds to the physical device you want to test your application on.
All these options give you the flexibility to test your app across different device configurations from within one single desktop player.
Now when the player is launched, you should see that the start and stop buttons of Gideros Studio are now enabled. And to run your project, all you need to do is click on the start button.
You might need to launch Gideros Player and Gideros Studio with proper permissions and even add them to your Antivirus or Firewall's exceptions list to allow them to connect.
The IP address and Gideros version of the player should disappear and you should only see a white screen there. That is because we did not actually display any graphical object as image. But what we did was printing some information to the console. So let's check the Output pane in the Gideros Studio.
As you see the Output pane, there are some information messages, like the fact that main.lua was uploaded and the uploading process to the Gideros Player was finished successfully; but it also displays any text we pass to Lua print command, as in our case it was Hello world!.
The Output pane is very handy for a simple debugging process by printing out the information using the print command. It also provides the error information if something is wrong with the project and it cannot be built.
Now when we know what an Output pane is, let's actually display something on the player's screen.
In this article, you've learned a few features about Gideros Studio, such as installing Gideros on your machine, creating your first project, how to use the Gideros Player, and trying out your first project.
Resources for Article:
- Getting Started with PlayStation Mobile [Article]
- Getting Started with Marmalade [Article]
- Getting Started with GameSalad [Article]