Gideros Studio Installation and Your First Code
-
Upload
giderosmobile -
Category
Documents
-
view
312 -
download
1
description
Transcript of Gideros Studio Installation and Your First Code
Gideros Mobile Academy 102
Gideros Studio: Installation and your
first code
GIDEROS MOBILE ACADEMY SERIES
• Downloading Gideros Studio
• Installing the prerequisites
• Installing Gideros Studio
• Running Gideros Studio
• Your first code!
Agenda
• You can use Gideros Studio standalone, without installing other 3rd party applications for building your application. – This way you can
• Evaluate the software• Run your application under Gideros Player, and • See how it'll feel like.
– However it may not be possible to test some of the features that come with device, e.g gyro, compass, etc.
• Therefore, in order to build for iOS and Android, you’ll need some libraries and IDE’s, such as – Java– Eclipse and Xcode
Gideros Studio requirements
• To build for iPhone/iPad real device, you'll need the
following:
• 64 bit Mac OS X Snow Leopard or Mac OS X Lion (for
compiling and signing)
• Xcode
• Apple Developer License
iPhone / iPad device build requirements
These are not required to build for Android
• To build for Android real device, you'll need the
following:
• Java SDK
• Eclipse IDE
• Android SDK 2.1 or higher
• Android Development Tools (ADT)
• (Later) Google Developer License – for sending apps
to Android markets.
Android device build requirements
These are not required to build for iOS (iPhone or iPad)
• Java is required if you want to modify, enhance and build
your application using Eclipse IDE. To install Java JDK,
follow these steps.
• Go to
http://www.oracle.com/technetwork/java/javase/downloads/
index.html
• Click on Java 7 JDK
• Choose your platform
• Install Java JDK on your system
Installing Java JDK
This step not required to build for iOS (iPhone or iPad)
• Eclipse is required to build APK files for Android. If you
are not going to build for this platform, then you may
skip this step. To install Eclipse, do the following:
• Go to http://eclipse.org/downloads/
• Choose your operating system
• Choose either 32 or 64 bit, depending on your operating
system, and download "Eclipse IDE for Java Developers".
• Extract the zip file to a folder
• Eclipse is now ready to run.
Installing Eclipse
This step not required to build for iOS (iPhone or iPad)
• Gideros Studio uses Android SDK 2.1 or higher, therefore
Android applications built with Gideros Studio runs on
devices running Android 2.1.
• Go to http://developer.android.com/sdk/index.html
• Download and install the package for the platform of
your choice.
• Run tools/android (Android SDK and AVD Manager)
• Click on Available Packages
• Install SDK Platform Android 2.1, API 7, revision 3
Installing Android SDK 2.1
This step not required to build for iOS (iPhone or iPad)
• ADT extends Eclipse to let you quickly modify your
application, which is exported from Gideros Studio.
• Using the Android SDK tools, you can export signed (or
unsigned) .apk files in order to distribute your application.
• Since Gideros Studio can export Java source code, you can
modify exported Java code before building the final APK
(Android package)
• Install ADT plugin for Eclipse using the installation steps
defined here: http://developer.android.com/sdk/eclipse-
adt.html
Installing Android Development Tools for Eclipse
This step not required to build for iOS (iPhone or iPad)
• Downloading and installing Gideros Studio is free.
• You are also encouraged to try beta builds, but make
sure that beta software may contain some bugs.
• System requirements:
• 1 Ghz processor
• 1 Gb RAM
• 250 Mb disk space for MS Windows
• 340 Mb disk space for Mac OS X
Downloading Gideros Studio
• For MS Windows:
• Double click on the executable you downloaded and
follow these steps:
• Choose destination folder
• Click install
• For Mac OS X:
• Double-click the .dmg file to mount it
• Drag & drop Gideros folder into your Applications
directory
Installing Gideros Studio
Lets have a look at the IDE
Projectpane
Image Preview pane
Start Page
or
Editor pane
Menu Bar
Output paneGideros Player
Multi-platform (Mac OS X,
Windwos and Linux support)
Start page for fast project
access
Code highlighting
Code folding
Code completion
Project manager
Asset preview pane
Directly runs the project on
player
Features of Gideros Studio IDE & Player
Written in Qt
Compiles Lua scripts before
export
Remembers all open tabs
8 scale modes to handle
different screen sizes
Support for several resolutions
Orientation support
Zoom in & out
Orientation & rotation
• Open Gideros Studio and create a new project from "File
→ New Project" menu. Name your project “HelloBall”
• Right click the project name at Project tab and select
"Add New File…" Name your file "main.lua" and click OK
(this is your main file)
• Double-click main.lua and write print("Hello Ball") in IDE.
• Press start button (or select "Player → Start" from main
menu) to run the project.
• You’ll see the output of your project at the "Output"
panel.
Your first code, hello ball
local background = Bitmap.new(Texture.new("field.png"))stage:addChild(background)
local fruit = Bitmap.new(Texture.new("ball.png"))
fruit.xdirection = 1fruit.ydirection = 1fruit.xspeed = 2.5fruit.yspeed = 4.3
stage:addChild(fruit)
function onEnterFrame(event) local x = fruit:getX() local y = fruit:getY()
x = x + (fruit.xspeed * fruit.xdirection) y = y + (fruit.yspeed * fruit.ydirection)
A more complex example
if x < 0 then fruit.xdirection = 1 end
if x > 320 - fruit:getWidth() then fruit.xdirection = -1 end
if y < 0 then fruit.ydirection = 1 end
if y > 480 - fruit:getHeight() then fruit.ydirection = -1 end
fruit:setX(x) fruit:setY(y)end
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)
• Copy the code below and paste it into main.lua
• Now let’s add some images to our asset library
• Download field.png and ball.png (URL below) and copy
these images to your project directory.
• Right click the project name and select "Add Existing
Files…" to add your image files to the project
Adding images to asset library
Field.png:
http://giderosmobile.com/documentation/assets/field.png
Ball.png: http://giderosmobile.com/documentation/assets/ball.png
• Now select "Player → Start Local Player” to start Gideros
Player.
• It shows the IP address of your PC and the player.
• After player opens, start and stop icons become enabled on the
toolbar.
• This means Gideros Studio is now connected to Gideros Player and
ready to upload your code and assets and then run the project.
• Press start button (or select "Player → Start" from main
menu) to run the project.
• Balls will be bouncing back and forth in the Player
Running in Gideros Player
GIDEROS MOBILE ACADEMY SERIES