How to port Libgdx to html5 - html

I've found the only article in Google
here.
But I don't understand it.
"Import the libgdx projects(checked out from svn) into your workspace in eclipse."
Hmm. There are no no detailed instruction how to do it.
And I'd like to port my own project, not someone's from svn.
I don't understand how to port superjumper example from svn anyway.
"Open project properties -> java build path in Eclipse.
In the projects tab, add gdx, gdx-backends-gwt and your libgdx project."
But the project tab is empty there. And "add" is turned off.
BTW, are Libgdx games on html5 extremely slow?
Thanks!

http://libgdx.badlogicgames.com/nightlies/dist/gdx-setup-ui.jar
download it and fill your project details...
It will create android, html and desktop project to your specified directory.
Import that to your eclipse and you are good to go.

Related

How to set up the configuration in Cursive for Clojurescript?

Just how to init a new project? How to compile, test and run?
Since the cursive user guide says nothing about cljs.
From the command line use boot or leiningen (also known as lein) to set up your project, then from within IntelliJ go File->Open on the directory for your application and edit the source files that will be collected up in a project for you. An important file to look at is project.clj - that's lein's project file, that IntelliJ will have picked up.
Setting up a lein cljs project from scratch is explained at Try Figwheel in here.
Best to use the Chrome browser. With Figwheel as you save the source files you are editing, your viewable changes show up in the browser window (or perhaps in the browser developer's console - good to have that open) you have open.
So you can just use IntelliJ as an editor. In the background Figwheel will see the changes you have made and if there's an error it will either show up in the 'heads up' display of the browser (i.e. the browser window), or in the console REPL which you have open. From the REPL you can do things like alerts that show up in the browser. All this explained on the Figwheel page...
There's quite a few moving parts (four altogether - two consoles, an editor and the browser Window). An interesting thing to note is that your FigWheel REPL console (your 'dos box') will be telling you where to open the browser, most likely at http://localhost:3449/.
Edit
Here's an alternative way of doing the Figwheel cljs project setup. More recent, and a bit more 'manual' than the 'Try Figwheel' description. Once finished just remove the Om-Next dependency if you don't want it.
Edit
Wanted to share that it is now quite possible to have a REPL in Cursive itself, so can confirm there is a better way than the 'dos box'. See Running it in here
Edit
Chestnut "beginner friendly Leiningen template for web applications" has just been made up-to-date with the current
state of the art.
Edit (26/04/2017)
Starting from scratch with Clojurescript

Launch LibGDX project with Android Studio

I've used "setup UI" to generate my LibGDX game projects.
Then I've imported them into Android Studio . It didn't show any errors at first , but when I've tried to run the android project , it gave me strange errors like :
java: cannot find symbol
symbol: variable super
location: class com.yan.waterworld.MainActivity
Here is an image :
How can it be solved (or worked around) ?
Update:
Since Android Studio 0.8.0 it is now possible to run Java and Android modules. This will not work by following these instructions (Android studio is based on Intellij).
Gradle Configuration
Old:
They have forums and notice here: https://code.google.com/p/libgdx/wiki/AndroidStudio
Using libgdx with Android Studio
At Google I/O 2013, the Android tools
team released Android Studio, and IDE based on IntelliJ IDEA, focusing
on pure Android development.
Android Studio is sadly unfit for libgdx projects at this time, as it
only allows the creation of Android projects. Standard Java projects
are not supported, and it is unclear if this will ever become
available.
Libgdx's cross-platform nature does not lend itself well to
development with Android Studio. This should not be a big hindrance,
as libgdx projects don't benefit much from Android Studios
capabilities. E.g. the layout preview is irrelevant for libgdx
applications, as they don't use native Android UI widgets. The inline
documentation support for Android APIs is also not needed for libgdx
applications.
However, we'll try to make developing libgdx applications with the new
Android Gradle build system possible in the near future.
If you must use Android Studio, check out this thread on the forums.
Alternatively you can use Intellij IDEA with libgdx, potentially with
Maven.
Creating games in gdx works perfectly fine in Android Studio. The best way to create a project for Android Studio is through gdx-setup. Please go to the following article
http://www.todroid.com/android-gdx-game-creation-part-i-setting-up-up-android-studio-for-creating-games/
It explains my experience in using the gdx-setup application, how to run it on the PC platform and steps for importing the gradle project and building a project in gradle.
When you have finished the article, hopefully you will have a fully working sample game template in which you can start building your game.
I tried to use a similiar method used for native libraries for now.
Last night, I was able to run examples; as a scratch project in Android Studio and wrote a quick guideline
Hope it helps you as well, but I am still learning so sorry in advance for any missing info or mistakes ;)
Here's the link.. http://bgnstudio.wordpress.com
I tried to use this way in detail:
create a new project in Android Studio.
From the libgdx nightly build, get;
Libgdx.so files within the armeabi/armeabi-v7a folders as needed.
Gdx.jar and gdx-source.jar
Gdx-backend-android.jar
Create lib and libs directories under project folder .
Copy armeabi* folders , gdx.jar and gdx-source.jar files under the “lib” directory.
Also copy the gdx-backend-android.jar into the “libs” directory.
*
In project tree; add gdx.jar and gdx-backend-android.jar as library.
In library settings, add gdx-source.jar under gdx.jar; Then open
module settings and add these libraries as dependencies. And check
them for compile.
Archive the armeabi folders together with parent directory to zip files and rename extension from zip to jar.
armeabi.jar : “/lib/armeabi/libgdx.so”
armeabi-v7a.jar :“/lib/armeabi-v7a/libgdx.so”
And move these jar files under “libs” directory.
Final apperance of the folders will be like this:
|-lib
|---gdx.jar
|---gdx-sorces.jar (added as source library of gdx.jar in library settings)
|-libs
|--- armeabi.jar
|--- armeabi-v7a.jar
|--- gdx-backend-android.jar
Now modify build.gradle file as well:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile files('lib/gdx.jar')
compile files('libs/gdx-backend-android.jar')
compile fileTree(dir: 'libs' , include:'*.jar')
}
Have you tried IntelliJ 13? Download it here . This new version covers most of the function of Android Studio, but still it can make Java Project. Take a look at this article
This EAP build includes all of the new features of Android Studio except for the new project wizard and the AppEngine cloud endpoints integration. These latter features will also appear in our EAP builds in the coming weeks.
take a look at libdgx documentation:
https://code.google.com/p/libgdx/wiki/IntelliJIDEALibgdx
mark the Advanced->IDEA checkbox at libgdx project setup tool, create the project and import it from android studio(you will need add the assets folder to desktop launcher or maybe somethings like this), it works for me.

compiling HTML5 to .exe/.dmg

I am currently beginning a project where we want to build an Interactive Whiteboard (educational activities) and deploy via CD-ROM. I want to build the project in HTML5 for it's interactivity and then somehow compile it to both .exe. and .dmg so when the CD-ROM is inserted it autoplays the 'Game'.
How is this possible? Any help/advice would be greatly appreciated. Thank you.
I already made a project using pure C (WinAPI) on github that can pack HTML files into single EXE using resources.
http://github.com/dns/WinAPI-Embed-Browser/releases
Use: res://programname.exe/test.html as path to access html files from your EXE file.
From here you also can hide the window border & just showing the content of your HTML app, or even running on fullscreen. This is very useful if you want to make interactive CD-ROM.
On Mac, you can use Delphi/Lazarus TWebBrowser control to load html files. However I don't know if mac program can access files from resource or not.
HTML 5 is a browser technology, so I think as long as the pc you are installing on has the latest browsers, installing your app should work fine.
Can you tell us why you want it as a CD-ROM based installation, where as you can easily host it online?
You may not need any .exe wrapping. Here is an approach.
Important: your autorun will be often disabled, [not so] quietly. Provide some instructions for running your application manually.
So:
Google for running a portable version of Firefox or Chrome from a CD. Have the browser prepared. Put it in a [sub]directory representing your CD.
Put your content there.
Create a .cmd file to invoke the browser with a command like,
FirefoxPortable.exe index.html
Create autorun.inf (details googlable) to call the above batch file.
Make a CD image from that directory. There are lots of CD burning applications that can do that.
Test.

flash builder 4.6 - native application issues -

I'm trying to follow a tutorial here:
http://www.as3nui.com/airkinect-2-0-is-here/
which deals with developing an AirKinect application in Flash Builder 4.6, which I've installed. But when I follow the steps, a bunch of menu commands that the tutorial accesses are not available to me. I'm developing an Actionscript project. When I go to the project properties, and click the actionscript build path from the left, in the video there are 3 tabs - source path tab, library tab, and native extensions tab, but I don't see native extensions tab. Furthermore, on the left, he has a menu called Actionscript build packaging - I do not have this. Lastly, he uses a command stage.nativeWindow.visible = false - when I use that it says it is an undefined property. I think that all of these issues have to do some how with the matter of native applications in flash builder, but I'm not sure. Anyone know what's going on?
You've probably started your project with the wrong settings. When you create a new ActionScript Project in Flash Builder 4.6, you can choose how it will run: in a browser or using AIR:
You should select the button "Desktop (runs in Adobe AIR)" under 'Application Type'. Then you will also see that native extensions tab in your project properties.
I don't know how to change an existing project into an AIR Desktop project but it should not be too difficult to create a new one and move your existing code into it.

Problem using Appmobi XDK!

plz anyone can tell me how to open our project at Appmobi XDK. i am facing a problem that i have install it but its not allow me to open projects. when i tried to open my project a message comes unable to open a project.
now i need your help guys.
Thanks
The very first thing you need to do is to go to xdk.appmobi.com (in google chrome) and download/install our xdk. (Need Java installed also)
During the install you will need to set a default appmobi directory. This is where your app files will be stored.
Create a new app from within the XDK. You can then click the edit the source code button in the tool bar to edit your code. Here you can update the file with your own code.
You can check out a video that explains the xdk at http://www.youtube.com/watch?v=MWV8kOJlGmc Some things might have changed visually with the current version of the XDK, but essentially its the same.
Some things have changed/moved around the screen since we made the video, but essentially its functionally the same.
Check it out as it will give you tips/how To's to using the XDK.
Also, posting in our forums (forums.appmobi.com) will get your questions answered sooner!