-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
319 lines (263 loc) · 21.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Gdxstudio by pyros2097</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Gdxstudio</h1>
<h2 class="project-tagline">An IDE for creating Games using libGDx and Java supported on all platforms Android, iOS, Desktop</h2>
<a href="https://github.com/pyros2097/GdxStudio" class="btn">View on GitHub</a>
<a href="https://github.com/pyros2097/GdxStudio/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/pyros2097/GdxStudio/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="deprecated" class="anchor" href="#deprecated" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Deprecated</h1>
<p>Please use <a href="https://github.com/UnderwaterApps/overlap2d">https://github.com/UnderwaterApps/overlap2d</a> instead. This project could have done pretty well but I didn't get enough time for complete it. Plus since I joined the startup culture I don't get much time to work on open source projects anymore. But the <strong>Idea</strong> was
really good and you know you could create games in java and json just like that. I thought of crowdfunding this at kickstarter as it seemed pretty good when it was working on my system but then I found out kickstarter is for US citizens only so that was a bummer. Then the I joined Playlyfe. And from then on it was something on the lines like this,</p>
<blockquote>
<p>I am a busy guy. When I first started this I was out of college searching for a job and had a lot of free time, which is way different from being in The Real World today.
My life consists of waking up -> getting stuck in a traffic -> working for 4 hours -> lunch for an hour -> working for 5 more hours -> getting stuck in traffic on the way home -> shower and sleep -> repeat 5 days a week. On weekends I have to run errands and research to stay competitive in an incredibly cut throat industry. I have very little time to spare.
An Excerpt taken from <a href="http://lazyfoo.net/contact.php">http://lazyfoo.net/contact.php</a></p>
</blockquote>
<h2>
<a id="gdxstudio-071" class="anchor" href="#gdxstudio-071" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>GdxStudio 0.7.1</h2>
<p>GdxStudio is used for creating awesome games using libGdx.<br>
It has all the features of libgdx built-in so you can easily,start creating games with it.<br>
Tools like Font Editor, Particle Editor, Texture Packer, SceneEditor, MapEditor, ActorEditor, ImagingTools are already built into it.
It also has a powerful Game Framework based on libGDX inbuilt which allows the game coder to concentrate on the logic of the game and not bother about setting up assets or configuration.<br>
Automatic Asset Loading including Atlas, TextureRegions, BitmapFonts, Music, Sound.<br>
It has the libGdx(v0.9.9) inside it so you don't need to download the libGdx at all, when exporting your game to jar for desktop it automatically loads these libraries into it. </p>
<p>(Will update this project to latest libgdx since I might get some time to work on this again and fix those issues)</p>
<blockquote>
<p><strong>Disclaimer</strong> This is not an official libdgx project so don't ask them for bug fixes </p>
</blockquote>
<p><a href="https://github.com/pyros2097/GdxStudio/wiki">See the Wiki for more details</a> </p>
<h2>
<a id="features" class="anchor" href="#features" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Features</h2>
<p><strong>1. Automatic Build System</strong><br>
Uses an Batch Builder system based on eclipse, so on the fly building so you can instantly
run or debug your application. Using the famous Eclipse Java Compiler(ECJ).<br>
<strong>2. Automatic File Saving</strong><br>
All Files are automatically save when you switch tabs or change views. No more wasting time pressing
CTRL+S or clicking the save button (inspired by Xcode).<br>
<strong>3. Source Editor</strong><br>
An eclipse like editor which supports code completion, batch compiling and compile errors as you type.<br>
<strong>4. Scene Editor</strong><br>
Completely design your game scenes with effects using the scene editor and access these components
in the source editor and add your logic code. Your scenes are saved in scene.json file is automatically loaded.<br>
<strong>5. Map Editor</strong><br>
All your game maps can be designed using it. This supports 3 map layers and 3 object layers.
You can drag and drop your custom actors/objects onto the map. There is no fixed size for a map.
Each tile can be anything you want it to be.<br>
<strong>6. Actor Editor</strong><br>
You can create custom actors/objects which consist of the basic widgets like images, sprites etc.
And you can drag and drop these into your game scenes and maps. Makes it easier instead of doing it by code.<br>
<strong>7. Export</strong><br>
All the libgdx libraries and class files are directly exported to your package.
Your game can be exported to jar for Desktop, apk for android and ipa for iOS<br>
<strong>8. Platform Independent</strong><br>
Write Once Deploy Everywhere. You only need to write you game logic for one platform, cross building
for different platforms and exporting is done automatically.(android and ios not done)<br>
<strong>9. Dynamic Compilation</strong><br>
You can edit your scenes and add logic to your game and at the same time see the outcome in the studio.
Your source files are automatically compiled and loaded into the class loader and displayed in the studio.
So your don't need to follow the monotonous approach compile->build->run exe. This saves a lot of time. </p>
<h2>
<a id="using" class="anchor" href="#using" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Using</h2>
<div class="highlight highlight-source-java"><pre> <span class="pl-c">//This is our first Scene and it shows the libgdx logo until all the assets are loaded </span>
<span class="pl-c">//then it automatically switches to the Menu scene</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-en">Splash</span> <span class="pl-k">extends</span> <span class="pl-e">Scene</span> {
<span class="pl-k">public</span> <span class="pl-en">Splash</span>() {
splashDuration <span class="pl-k">=</span> <span class="pl-c1">5f</span>; <span class="pl-c">// This will make my splash scene to wait 5 seconds after assets are all loaded</span>
<span class="pl-k">final</span> <span class="pl-smi">Texture</span> bg1 <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-smi">Texture</span>(<span class="pl-s"><span class="pl-pds">"</span>splash/libgdx.png<span class="pl-pds">"</span></span>);
<span class="pl-k">final</span> <span class="pl-smi">Image</span> imgbg1 <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-smi">Image</span>(bg1);
imgbg1<span class="pl-k">.</span>setFillParent(<span class="pl-c1">true</span>);
addActor(imgbg1);
}
}
<span class="pl-c">//This is Scene gets called once the assets are loaded</span>
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-en">Menu</span> <span class="pl-k">extends</span> <span class="pl-e">Scene</span> {
<span class="pl-k">public</span> <span class="pl-en">Menu</span>() {
<span class="pl-c">//create some actors</span>
<span class="pl-c">// if you used sink studio and create a scene like Menu.json then</span>
<span class="pl-c">// it will automatically call load("Menu") it will populate your scene after parsing the json file</span>
<span class="pl-c">//you can access these objects like this</span>
<span class="pl-smi">TextButton</span> btn <span class="pl-k">=</span> (<span class="pl-smi">TextButton</span>) findActor(<span class="pl-s"><span class="pl-pds">"</span>TextButton1<span class="pl-pds">"</span></span>);
<span class="pl-smi">Image</span> img <span class="pl-k">=</span> (<span class="pl-smi">Image</span>) findActor(<span class="pl-s"><span class="pl-pds">"</span>Image5<span class="pl-pds">"</span></span>);
<span class="pl-c">// these actors are loaded from the json file and are give names which allows</span>
<span class="pl-c">// easy access to them</span>
}
}</pre></div>
<h2>
<a id="todo" class="anchor" href="#todo" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Todo</h2>
<ol>
<li>MapEditor</li>
<li>ActorEditor</li>
<li>Automatic Updates</li>
<li>Make a signals/slots method for connecting actors with events (maybe make an interpreter)</li>
</ol>
<h2>
<a id="credits" class="anchor" href="#credits" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Credits</h2>
<p>Thanks to all these awesome frameworks<br>
<a href="http://libgdx.badlogicgames.com">Libgdx</a><br>
<a href="http://weblookandfeel.com">WebLookAndFeel</a><br>
<a href="http://fifesoft.com/rsyntaxtextarea">RSyntaxTextArea</a><br>
<a href="https://github.com/pyros2097/WebLookAndFeelLite">WebLookAndFeelLite</a><br>
<a href="https://github.com/pyros2097/Scene3d">Scene3d</a><br>
<a href="https://github.com/pyros2097/Sink">Sink</a><br>
<a href="http://download.eclipse.org/eclipse/downloads/">EclipseCompiler</a><br>
<a href="http://www.antlr.org/">ANTLR</a><br>
<a href="http://proguard.sourceforge.net">ProGuard</a> </p>
<h2>
<a id="screenshots" class="anchor" href="#screenshots" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Screenshots</h2>
<p><img src="https://github.com/pyros2097/GdxStudio/raw/master/shots/shot2.png">
<img src="https://github.com/pyros2097/GdxStudio/raw/master/shots/shot3.png">
<img src="https://github.com/pyros2097/GdxStudio/raw/master/shots/shot4.png">
<img src="https://github.com/pyros2097/GdxStudio/raw/master/shots/shot5.png">
<img src="https://github.com/pyros2097/GdxStudio/raw/master/shots/shot6.png"></p>
<h2>
<a id="documentation" class="anchor" href="#documentation" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Documentation</h2>
<h2>
<a id="scene" class="anchor" href="#scene" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Scene</h2>
<pre><code><p>
It consists of a single Stage2d, Stage3d, Camera2d, and Camera3d which are all initialized based on the config file.
The root of the stage can be accessed in a statically {@link Scene#getRoot()} and methods related to camera like moveTo, moveBy,
are also accessed the same way.<br>
It has extra things like stateTime, gameUptime, pauseState<br>
It has automatic asset unloading and disposing and you can use {@link #exit()} to quit your game safely
Note: Your TMX maps have to be unloaded manually as they can be huge resources needing to be freed early.
It has static methods which can be used for panning the camera using mouse, keyboard, drag.. etc.
It can also automatically follow a actor by using followActor(Actor actor)<br>
This class will register all your scenes based on your scene.json file and then you can switch you scenes by using {@link #setScene}
method with the sceneClassName.<br>
All your assets are loaded in the background(asynchronously) in the first scene and then automatically
the next scene in the list is set.
You can stop the stage from switching to the next scene by setting Asset.loadAsynchronous = false in your first scene but then
you have to load all the assets by using the blocking call Asset.loadBlocking()
If you want to display your splash screen for more time after the assets have loaded then you can change
Stage.splashDuration to the amount of time you want you splash screen to show. By default the splash screen's
lifetime is finished once the assets are loaded and then the next scene is set.
</p>
</code></pre>
<h2>
<a id="camera" class="anchor" href="#camera" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Camera</h2>
<div class="highlight highlight-source-java"><pre><span class="pl-c">/*</span>
<span class="pl-c"> * This is to set the offsets of camera position when following the actor</span>
<span class="pl-c"> * When the camera follows the actor its (x,y) position is set to actor's (x,y) position</span>
<span class="pl-c"> * based on followSpeed. The offsets are used to position the camera in such a way that the actor</span>
<span class="pl-c"> * doesn't need to be at the center of the camera always</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">Rectangle</span> followOffset;
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">boolean</span> usePan;
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">boolean</span> useDrag;
<span class="pl-c">/*</span>
<span class="pl-c"> * This sets the boundary of the camera till what position can it move or pan in the</span>
<span class="pl-c"> * directions left, right, top, down. This is to prevent is from panning overboard the game area.</span>
<span class="pl-c"> * Usually the bounds of the camera is like a rectangle. This must be calculated carefully</span>
<span class="pl-c"> * as the camera's position is based on its center.</span>
<span class="pl-c">*/</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">Rectangle</span> bounds;
<span class="pl-c">/*</span>
<span class="pl-c"> * Moves the camera to x,y over a time duration</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">void</span> moveTo(<span class="pl-k">float</span> x, <span class="pl-k">float</span> y, <span class="pl-k">float</span> duration);
<span class="pl-c">/*</span>
<span class="pl-c"> * Moves the camera by amountX, amountY over a time duration</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> moveBy (<span class="pl-k">float</span> amountX, <span class="pl-k">float</span> amountY, <span class="pl-k">float</span> duration);
<span class="pl-c">/*</span>
<span class="pl-c"> * Moves the camera by amountX, amountY over a time duration and interpolation interp</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> moveBy (<span class="pl-k">float</span> amountX, <span class="pl-k">float</span> amountY, <span class="pl-k">float</span> dur, <span class="pl-smi">Interpolation</span> interp);
<span class="pl-c">/*</span>
<span class="pl-c"> * This makes the camera follow the actor once and only once. Once the camera reaches its</span>
<span class="pl-c"> * target, it stops following the actor.</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> followActor(<span class="pl-smi">Actor</span> actor);
<span class="pl-c">/*</span>
<span class="pl-c"> * This makes the camera follow the actor continuously, even after the camera reaches its</span>
<span class="pl-c"> * target, it keeps following the if the actor changes its position.</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> followActorContinuously(<span class="pl-smi">Actor</span> actor);
<span class="pl-c">/*</span>
<span class="pl-c"> * Sets the speed at which the camera follows the actor. By default it moves 1px for a duration of 1f</span>
<span class="pl-c"> * so its speed is 1px/f. So reduce the duration to increase its speed.</span>
<span class="pl-c"> * ex: setPanSpeed(0.5) will change its speed to 2px/f</span>
<span class="pl-c"> * Here: f can/maybe also indicate seconds</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> setFollowSpeed(<span class="pl-k">float</span> duration);
<span class="pl-c">/*</span>
<span class="pl-c"> * Sets the speed at which the camera pans. By default it moves 1px for a duration a 1f</span>
<span class="pl-c"> * so its speed is 1px/f. So reduce the duration to increase its speed.</span>
<span class="pl-c"> * ex: setPanSpeed(0.5) will change its speed to 2px/f</span>
<span class="pl-c"> * Here: f can/maybe also indicate seconds </span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">void</span> setPanSpeed(<span class="pl-k">float</span> duration);
<span class="pl-c">/* If you want to make any elements/actors to move along with the camera </span>
<span class="pl-c"> * like HUD's add them using this method */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> addHud(<span class="pl-smi">Actor</span> actor);
<span class="pl-c">/* If you want to any elements/actors which was a Hud the use this */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> removeHud(<span class="pl-smi">Actor</span> actor);
<span class="pl-c">/*</span>
<span class="pl-c"> * Clears all hud's registerd with the camera</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> clearAllHud();
<span class="pl-c">/*</span>
<span class="pl-c"> * Returns the x postion of the camera</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">float</span> getX();
<span class="pl-c">/*</span>
<span class="pl-c"> * Returns the y postion of the camera</span>
<span class="pl-c"> */</span>
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">float</span> getY(); </pre></div>
<h2>
<a id="asset" class="anchor" href="#asset" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Asset</h2>
<p><b>#Important </b> <br>
All asset files must be lowercase only.. otherwise it causes problems with android <br>
Automatic Asset Loading the directory Structure should be like this <br>
This class automatically loads all the assets in the prescribed folders into the appropriate
class types. All This can be accessed using an neat api.</p>
<p>icon.png --- your game icon to be displayed on the window<br>
atlas/ --- all your Texture Atlas files .atlas and .png go here<br>
font/ --- all your BitmapFont files .fnt and .png go here<br>
music/ --- all your Music files .mp3 go here<br>
sound/ --- all your Music files .mp3 go here<br>
particle/ --- all your Particle files .part go here<br>
map/ --- all your TMX map files along with tilesets go here<br>
pack/ --- all your image files which are to be packed are to be stored here<br>
so that they are automatically packed by the texture packer and stored in
the atlas folder</p>
<p>All the assets are read from their particular folders and an asset.json file is created with
the filenames:
ex: asset.json<br>
{
"font": "arial.fnt, font1",
"atlas": "image.atlas",
"sound": "click.mp3,gg.mp3",
"music": "title.mp3,"bg.mp3",
}</p>
<div class="highlight highlight-source-java"><pre><span class="pl-c">//All assets are accessed this way, To load TextureRegion</span>
<span class="pl-smi">TextureRegion</span> cat <span class="pl-k">=</span> <span class="pl-smi">Asset</span><span class="pl-k">.</span>tex(<span class="pl-s"><span class="pl-pds">"</span>cat<span class="pl-pds">"</span></span>);
<span class="pl-c">//To load Animation</span>
<span class="pl-smi">Animation</span> catAnim <span class="pl-k">=</span> <span class="pl-smi">Asset</span><span class="pl-k">.</span>anim(<span class="pl-s"><span class="pl-pds">"</span>cat<span class="pl-pds">"</span></span>);
<span class="pl-smi">BitmapFont</span> font1 <span class="pl-k">=</span> <span class="pl-smi">Asset</span><span class="pl-k">.</span>font(<span class="pl-s"><span class="pl-pds">"</span>font1<span class="pl-pds">"</span></span>);
<span class="pl-c">//The music and sound files are automatically cached and can be played by invoking:</span>
<span class="pl-smi">Asset</span><span class="pl-k">.</span>musicPlay(<span class="pl-s"><span class="pl-pds">"</span>musicname<span class="pl-pds">"</span></span>);
<span class="pl-smi">Asset</span><span class="pl-k">.</span>soundPlay(<span class="pl-s"><span class="pl-pds">"</span>soundname<span class="pl-pds">"</span></span>);
<span class="pl-c">//The asset functions will return null for Font, TextureRegion and Animation if the asset cannot be found</span></pre></div>
<p><a href="https://bitdeli.com/free" title="Bitdeli Badge"><img src="https://d2weczhvl823v0.cloudfront.net/pyros2097/gdxstudio/trend.png" alt="Bitdeli Badge"></a></p>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/pyros2097/GdxStudio">Gdxstudio</a> is maintained by <a href="https://github.com/pyros2097">pyros2097</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>