Skip to content

Commit 9cc1d79

Browse files
committed
First release
1 parent d5068ff commit 9cc1d79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2108
-0
lines changed

src/CityApp-app.xml

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="no"?>
2+
<application xmlns="http://ns.adobe.com/air/application/20.0">
3+
4+
<!-- Adobe AIR Application Descriptor File Template.
5+
6+
Specifies parameters for identifying, installing, and launching AIR applications.
7+
8+
xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.5
9+
The last segment of the namespace specifies the version
10+
of the AIR runtime required for this application to run.
11+
12+
minimumPatchLevel - The minimum patch level of the AIR runtime required to run
13+
the application. Optional.
14+
-->
15+
16+
<!-- A universally unique application identifier. Must be unique across all AIR applications.
17+
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
18+
<id>im.phantom.cityapp</id>
19+
20+
<!-- Used as the filename for the application. Required. -->
21+
<filename>City App</filename>
22+
23+
<!-- The name that is displayed in the AIR application installer.
24+
May have multiple values for each language. See samples or xsd schema file. Optional. -->
25+
<name>City App</name>
26+
27+
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
28+
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
29+
An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 .
30+
For iOS Apps, this represents build number. -->
31+
<versionNumber>1.0.0</versionNumber>
32+
33+
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users.
34+
For iOS Apps, this represents application version number and format should be (<0-999>.<0-999>.<0-999>).
35+
If this tag is not specified or the value is not according to the format, then this tag will be ignored
36+
and <versionNumber> will be used for application version number. Optional. -->
37+
<!-- <versionLabel></versionLabel> -->
38+
39+
<!-- Description, displayed in the AIR application installer.
40+
May have multiple values for each language. See samples or xsd schema file. Optional. -->
41+
<!-- <description></description> -->
42+
43+
<!-- Copyright information. Optional -->
44+
<!-- <copyright></copyright> -->
45+
46+
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
47+
<!-- <publisherID></publisherID> -->
48+
49+
<!-- Settings for the application's initial window. Required. -->
50+
<initialWindow>
51+
<!-- The main SWF or HTML file of the application. Required. -->
52+
<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
53+
<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>
54+
55+
<!-- The title of the main window. Optional. -->
56+
<!-- <title></title> -->
57+
58+
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
59+
<!-- <systemChrome></systemChrome> -->
60+
61+
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
62+
<!-- <transparent></transparent> -->
63+
64+
<!-- Whether the window is initially visible. Optional. Default false. -->
65+
<!-- <visible></visible> -->
66+
67+
<!-- Whether the user can minimize the window. Optional. Default true. -->
68+
<!-- <minimizable></minimizable> -->
69+
70+
<!-- Whether the user can maximize the window. Optional. Default true. -->
71+
<!-- <maximizable></maximizable> -->
72+
73+
<!-- Whether the user can resize the window. Optional. Default true. -->
74+
<!-- <resizable></resizable> -->
75+
76+
<!-- The window's initial width in pixels. Optional. -->
77+
<!-- <width></width> -->
78+
79+
<!-- The window's initial height in pixels. Optional. -->
80+
<!-- <height></height> -->
81+
82+
<!-- The window's initial x position. Optional. -->
83+
<!-- <x></x> -->
84+
85+
<!-- The window's initial y position. Optional. -->
86+
<!-- <y></y> -->
87+
88+
<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
89+
<!-- <minSize></minSize> -->
90+
91+
<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
92+
<!-- <maxSize></maxSize> -->
93+
94+
<!-- The aspect ratio of the app ("portrait" or "landscape" or "any"). Optional. Mobile only. Default is the natural orientation of the device -->
95+
96+
<!-- <aspectRatio></aspectRatio> -->
97+
98+
<!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
99+
100+
<!-- <autoOrients></autoOrients> -->
101+
102+
<!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
103+
104+
<!-- <fullScreen></fullScreen> -->
105+
106+
<!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto -->
107+
108+
<renderMode>direct</renderMode>
109+
110+
<!-- Whether the default direct mode rendering context allocates storage for depth and stencil buffers. Optional. Default false. -->
111+
<!-- <depthAndStencil></depthAndStencil> -->
112+
113+
<!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none"). Optional. Defaults "pan." -->
114+
<!-- <softKeyboardBehavior></softKeyboardBehavior> -->
115+
116+
<!-- Display Resolution for the app (either "standard" or "high"). Optional, OSX-only. Default "standard" -->
117+
<!-- <requestedDisplayResolution></requestedDisplayResolution> -->
118+
<autoOrients>true</autoOrients>
119+
<fullScreen>false</fullScreen>
120+
<visible>true</visible>
121+
</initialWindow>
122+
123+
<!-- We recommend omitting the supportedProfiles element, -->
124+
<!-- which in turn permits your application to be deployed to all -->
125+
<!-- devices supported by AIR. If you wish to restrict deployment -->
126+
<!-- (i.e., to only mobile devices) then add this element and list -->
127+
<!-- only the profiles which your application does support. -->
128+
<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
129+
130+
<!-- Languages supported by application -->
131+
<!-- Only these languages can be specified -->
132+
<!-- <supportedLanguages>en de cs es fr it ja ko nl pl pt ru sv tr zh</supportedLanguages> -->
133+
134+
<!-- The subpath of the standard default installation location to use. Optional. -->
135+
<!-- <installFolder></installFolder> -->
136+
137+
<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
138+
<!-- <programMenuFolder></programMenuFolder> -->
139+
140+
<!-- The icon the system uses for the application. For at least one resolution,
141+
specify the path to a PNG file included in the AIR package. Optional. -->
142+
<icon>
143+
<!--<image16x16></image16x16>
144+
<image29x29></image29x29>
145+
<image32x32></image32x32>
146+
<image36x36></image36x36>-->
147+
<image40x40>assets/icon-40.png</image40x40>
148+
<image48x48>assets/icon-48.png</image48x48>
149+
<image50x50>assets/icon-50.png</image50x50>
150+
<image57x57>assets/icon-57.png</image57x57>
151+
<image58x58>assets/icon-58.png</image58x58>
152+
<image72x72>assets/icon-72.png</image72x72>
153+
<image76x76>assets/icon-76.png</image76x76>
154+
<image80x80>assets/icon-80.png</image80x80>
155+
<image96x96>assets/icon-96.png</image96x96>
156+
<image100x100>assets/icon-100.png</image100x100>
157+
<image114x114>assets/icon-114.png</image114x114>
158+
<image120x120>assets/icon-120.png</image120x120>
159+
<image144x144>assets/icon-144.png</image144x144>
160+
<image152x152>assets/icon-152.png</image152x152>
161+
<image512x512>assets/icon-512.png</image512x512>
162+
</icon>
163+
164+
<!-- Whether the application handles the update when a user double-clicks an update version
165+
of the AIR file (true), or the default AIR application installer handles the update (false).
166+
Optional. Default false. -->
167+
<!-- <customUpdateUI></customUpdateUI> -->
168+
169+
<!-- Whether the application can be launched when the user clicks a link in a web browser.
170+
Optional. Default false. -->
171+
<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
172+
173+
<!-- Listing of file types for which the application can register. Optional. -->
174+
<!-- <fileTypes> -->
175+
176+
<!-- Defines one file type. Optional. -->
177+
<!-- <fileType> -->
178+
179+
<!-- The name that the system displays for the registered file type. Required. -->
180+
<!-- <name></name> -->
181+
182+
<!-- The extension to register. Required. -->
183+
<!-- <extension></extension> -->
184+
185+
<!-- The description of the file type. Optional. -->
186+
<!-- <description></description> -->
187+
188+
<!-- The MIME content type. -->
189+
<!-- <contentType></contentType> -->
190+
191+
<!-- The icon to display for the file type. Optional. -->
192+
<!-- <icon>
193+
<image16x16></image16x16>
194+
<image32x32></image32x32>
195+
<image48x48></image48x48>
196+
<image128x128></image128x128>
197+
</icon> -->
198+
199+
<!-- </fileType> -->
200+
<!-- </fileTypes> -->
201+
202+
<!-- iOS specific capabilities -->
203+
<!-- <iPhone> -->
204+
<!-- A list of plist key/value pairs to be added to the application Info.plist -->
205+
<!-- <InfoAdditions>
206+
<![CDATA[
207+
<key>UIDeviceFamily</key>
208+
<array>
209+
<string>1</string>
210+
<string>2</string>
211+
</array>
212+
<key>UIStatusBarStyle</key>
213+
<string>UIStatusBarStyleBlackOpaque</string>
214+
<key>UIRequiresPersistentWiFi</key>
215+
<string>YES</string>
216+
]]>
217+
</InfoAdditions> -->
218+
<!-- A list of plist key/value pairs to be added to the application Entitlements.plist -->
219+
<!-- <Entitlements>
220+
<![CDATA[
221+
<key>keychain-access-groups</key>
222+
<array>
223+
<string></string>
224+
<string></string>
225+
</array>
226+
]]>
227+
</Entitlements> -->
228+
<!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" -->
229+
<!-- <requestedDisplayResolution></requestedDisplayResolution> -->
230+
<!-- Forcing Render Mode CPU for the devices mentioned. Optional -->
231+
<!-- <forceCPURenderModeForDevices></forceCPURenderModeForDevices> -->
232+
<!-- File containing line separated list of external swf paths. These swfs won't be
233+
packaged inside the application and corresponding stripped swfs will be output in
234+
externalStrippedSwfs folder. -->
235+
<!-- <externalSwfs></externalSwfs> -->
236+
<!-- </iPhone> -->
237+
238+
<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
239+
<!--<android> -->
240+
<!-- <manifestAdditions>
241+
<![CDATA[
242+
<manifest android:installLocation="auto">
243+
<uses-permission android:name="android.permission.INTERNET"/>
244+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
245+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
246+
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
247+
<application android:enabled="true">
248+
<activity android:excludeFromRecents="false">
249+
<intent-filter>
250+
<action android:name="android.intent.action.MAIN"/>
251+
<category android:name="android.intent.category.LAUNCHER"/>
252+
</intent-filter>
253+
</activity>
254+
</application>
255+
</manifest>
256+
]]>
257+
</manifestAdditions> -->
258+
<!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
259+
<!-- <colorDepth></colorDepth> -->
260+
<!-- Indicates if the app contains video or not. Necessary for ordering of video planes with graphics plane, especially in Jellybean - if you app does video this must be set to true - valid values are true or false -->
261+
<!-- <containsVideo></containsVideo> -->
262+
<!-- </android> -->
263+
<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
264+
<android>
265+
<colorDepth>16bit</colorDepth>
266+
<manifestAdditions><![CDATA[
267+
<manifest android:installLocation="auto">
268+
<application android:hardwareAccelerated="true"/>
269+
<!--See the Adobe AIR documentation for more information about setting Google Android permissions-->
270+
<!--Removing the permission android.permission.INTERNET will have the side effect
271+
of preventing you from debugging your application on your device-->
272+
<uses-permission android:name="android.permission.INTERNET"/>
273+
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
274+
<!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
275+
<!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
276+
<!--The DISABLE_KEYGUARD and WAKE_LOCK permissions should be toggled together
277+
in order to access AIR's SystemIdleMode APIs-->
278+
<!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
279+
<uses-permission android:name="android.permission.WAKE_LOCK"/>
280+
<!--<uses-permission android:name="android.permission.CAMERA"/>-->
281+
<!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
282+
<!--The ACCESS_NETWORK_STATE and ACCESS_WIFI_STATE permissions should be toggled
283+
together in order to use AIR's NetworkInfo APIs-->
284+
<!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
285+
<!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
286+
</manifest>
287+
288+
]]></manifestAdditions>
289+
</android>
290+
<iPhone>
291+
<InfoAdditions><![CDATA[
292+
<key>UIDeviceFamily</key>
293+
<array>
294+
<string>1</string>
295+
<string>2</string>
296+
</array>
297+
<key>UIPrerenderedIcon</key>
298+
<true/>
299+
]]></InfoAdditions>
300+
<requestedDisplayResolution>high</requestedDisplayResolution>
301+
</iPhone>
302+
</application>

src/CityApp.as

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package
2+
{
3+
4+
import flash.display.Bitmap;
5+
import flash.display.Loader;
6+
import flash.display.Sprite;
7+
import flash.display.StageAlign;
8+
import flash.display.StageScaleMode;
9+
import flash.display3D.Context3DRenderMode;
10+
import flash.events.Event;
11+
12+
import feathers.utils.ScreenDensityScaleFactorManager;
13+
14+
import starling.core.Starling;
15+
16+
[SWF(width="320",height="480",frameRate="60",backgroundColor="#333333")]
17+
18+
public class CityApp extends Sprite
19+
{
20+
private var Splash:Class;
21+
private var splash:Bitmap;
22+
23+
private var _starling:Starling;
24+
private var _scaler:ScreenDensityScaleFactorManager;
25+
private var _launchImage:Loader;
26+
private var _savedAutoOrients:Boolean;
27+
28+
public function CityApp()
29+
{
30+
if(this.stage)
31+
{
32+
this.stage.scaleMode = StageScaleMode.NO_SCALE;
33+
this.stage.align = StageAlign.TOP_LEFT;
34+
}
35+
36+
this.mouseEnabled = this.mouseChildren = false;
37+
this.loaderInfo.addEventListener(Event.COMPLETE, loaderInfo_completeHandler);
38+
}
39+
40+
private function loaderInfo_completeHandler(event:Event):void
41+
{
42+
Starling.handleLostContext = true;
43+
Starling.multitouchEnabled = true;
44+
45+
this._starling = new Starling(Main, this.stage, null, null, Context3DRenderMode.AUTO, "auto");
46+
this._scaler = new ScreenDensityScaleFactorManager(this._starling);
47+
this._starling.enableErrorChecking = false;
48+
//this._starling.showStats = true;
49+
50+
this._starling.start();
51+
this.stage.addEventListener(Event.DEACTIVATE, stage_deactivateHandler, false, 0, true);
52+
}
53+
54+
private function stage_deactivateHandler(event:Event):void
55+
{
56+
this._starling.stop();
57+
this.stage.addEventListener(Event.ACTIVATE, stage_activateHandler, false, 0, true);
58+
}
59+
60+
private function stage_activateHandler(event:Event):void
61+
{
62+
this.stage.removeEventListener(Event.ACTIVATE, stage_activateHandler);
63+
this._starling.start();
64+
}
65+
66+
}
67+
}

0 commit comments

Comments
 (0)