├── .gitignore
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── samples
├── demo_mobile
│ ├── .vscode
│ │ └── launch.json
│ ├── README.md
│ ├── asconfig.json
│ ├── assets
│ │ ├── audio
│ │ │ └── wing_flap.mp3
│ │ ├── fonts
│ │ │ ├── 1x
│ │ │ │ ├── desyrel.fnt
│ │ │ │ └── desyrel.png
│ │ │ ├── 2x
│ │ │ │ ├── desyrel.fnt
│ │ │ │ └── desyrel.png
│ │ │ ├── Ubuntu-License.txt
│ │ │ └── Ubuntu-R.ttf
│ │ └── textures
│ │ │ ├── 1x
│ │ │ ├── atlas.png
│ │ │ ├── atlas.xml
│ │ │ ├── background.jpg
│ │ │ └── compressed_texture.atf
│ │ │ └── 2x
│ │ │ ├── atlas.png
│ │ │ ├── atlas.xml
│ │ │ ├── background.jpg
│ │ │ └── compressed_texture.atf
│ ├── demo-mobile.iml
│ ├── src
│ │ ├── Constants.as
│ │ ├── Demo-app.xml
│ │ ├── Demo.as
│ │ ├── Game.as
│ │ ├── MainMenu.as
│ │ ├── scenes
│ │ │ ├── AnimationScene.as
│ │ │ ├── BenchmarkScene.as
│ │ │ ├── BlendModeScene.as
│ │ │ ├── CustomHitTestScene.as
│ │ │ ├── FilterScene.as
│ │ │ ├── MaskScene.as
│ │ │ ├── MovieScene.as
│ │ │ ├── RenderTextureScene.as
│ │ │ ├── Scene.as
│ │ │ ├── Sprite3DScene.as
│ │ │ ├── TextScene.as
│ │ │ ├── TextureScene.as
│ │ │ └── TouchScene.as
│ │ └── utils
│ │ │ ├── MenuButton.as
│ │ │ ├── ProgressBar.as
│ │ │ ├── RoundButton.as
│ │ │ ├── TextButton.as
│ │ │ └── TouchSheet.as
│ └── system
│ │ ├── Assets.car
│ │ ├── LaunchScreen.storyboardc
│ │ ├── 01J-lp-oVM-view-Ze5-6b-2t3.nib
│ │ ├── Info.plist
│ │ └── UIViewController-01J-lp-oVM.nib
│ │ ├── icon114.png
│ │ ├── icon144.png
│ │ ├── icon57.png
│ │ ├── icon72.png
│ │ └── res
│ │ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── icon.png
│ │ ├── icon_background.png
│ │ ├── icon_foreground.png
│ │ └── icon_round.png
│ │ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ ├── icon_background.png
│ │ ├── icon_foreground.png
│ │ └── icon_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── icon.png
│ │ ├── icon_background.png
│ │ ├── icon_foreground.png
│ │ └── icon_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── icon.png
│ │ ├── icon_background.png
│ │ ├── icon_foreground.png
│ │ └── icon_round.png
│ │ └── mipmap-xxxhdpi
│ │ ├── icon.png
│ │ ├── icon_background.png
│ │ ├── icon_foreground.png
│ │ └── icon_round.png
├── demo_web
│ ├── README.md
│ ├── asconfig.json
│ └── src
│ │ ├── Demo_Web.as
│ │ ├── Demo_Web_Preloader.as
│ │ └── EmbeddedAssets.as
└── scaffold_mobile
│ ├── .vscode
│ └── launch.json
│ ├── README.md
│ ├── asconfig.json
│ ├── assets
│ ├── audio
│ │ └── click.mp3
│ ├── fonts
│ │ ├── 1x
│ │ │ ├── desyrel.fnt
│ │ │ └── desyrel.png
│ │ ├── 2x
│ │ │ ├── desyrel.fnt
│ │ │ └── desyrel.png
│ │ ├── Ubuntu-License.txt
│ │ └── Ubuntu-R.ttf
│ └── textures
│ │ ├── 1x
│ │ ├── atlas.png
│ │ ├── atlas.xml
│ │ └── logo.png
│ │ └── 2x
│ │ ├── atlas.png
│ │ ├── atlas.xml
│ │ └── logo.png
│ ├── scaffold-mobile.iml
│ ├── src
│ ├── Game.as
│ ├── Menu.as
│ ├── Root.as
│ ├── Scaffold-app.xml
│ ├── Scaffold.as
│ ├── Scene.as
│ └── utils
│ │ ├── MenuButton.as
│ │ ├── ProgressBar.as
│ │ ├── SafeAreaOverlay.as
│ │ └── ScreenSetup.as
│ └── system
│ ├── Assets.car
│ ├── LaunchScreen.storyboardc
│ ├── 01J-lp-oVM-view-Ze5-6b-2t3.nib
│ ├── Info.plist
│ └── UIViewController-01J-lp-oVM.nib
│ ├── icon114.png
│ ├── icon144.png
│ ├── icon57.png
│ ├── icon72.png
│ └── res
│ ├── mipmap-anydpi-v26
│ ├── icon.xml
│ └── icon_round.xml
│ ├── mipmap-hdpi
│ ├── icon.png
│ ├── icon_background.png
│ ├── icon_foreground.png
│ └── icon_round.png
│ ├── mipmap-mdpi
│ ├── icon.png
│ ├── icon_background.png
│ ├── icon_foreground.png
│ └── icon_round.png
│ ├── mipmap-xhdpi
│ ├── icon.png
│ ├── icon_background.png
│ ├── icon_foreground.png
│ └── icon_round.png
│ ├── mipmap-xxhdpi
│ ├── icon.png
│ ├── icon_background.png
│ ├── icon_foreground.png
│ └── icon_round.png
│ └── mipmap-xxxhdpi
│ ├── icon.png
│ ├── icon_background.png
│ ├── icon_foreground.png
│ └── icon_round.png
├── starling
├── asconfig.json
├── bin
│ └── README.md
├── build
│ ├── ant
│ │ ├── build.properties
│ │ └── build.xml
│ ├── apm
│ │ └── Rakefile
│ ├── idea
│ │ ├── .idea
│ │ │ ├── .name
│ │ │ ├── compiler.xml
│ │ │ ├── copyright
│ │ │ │ └── profiles_settings.xml
│ │ │ ├── encodings.xml
│ │ │ ├── flexCompiler.xml
│ │ │ ├── misc.xml
│ │ │ ├── modules.xml
│ │ │ ├── scopes
│ │ │ │ └── scope_settings.xml
│ │ │ └── vcs.xml
│ │ └── README.md
│ └── shared
│ │ └── package-descriptions.xml
├── doc
│ ├── .gitignore
│ └── generate.sh
├── src
│ ├── com
│ │ └── adobe
│ │ │ └── utils
│ │ │ └── AGALMiniAssembler.as
│ └── starling
│ │ ├── animation
│ │ ├── BezierEasing.as
│ │ ├── DelayedCall.as
│ │ ├── IAnimatable.as
│ │ ├── Juggler.as
│ │ ├── Transitions.as
│ │ └── Tween.as
│ │ ├── assets
│ │ ├── AssetFactory.as
│ │ ├── AssetFactoryHelper.as
│ │ ├── AssetManager.as
│ │ ├── AssetReference.as
│ │ ├── AssetType.as
│ │ ├── AtfTextureFactory.as
│ │ ├── BitmapTextureFactory.as
│ │ ├── ByteArrayFactory.as
│ │ ├── DataLoader.as
│ │ ├── JsonFactory.as
│ │ ├── SoundFactory.as
│ │ └── XmlFactory.as
│ │ ├── core
│ │ ├── Starling.as
│ │ ├── StatsDisplay.as
│ │ └── starling_internal.as
│ │ ├── display
│ │ ├── BlendMode.as
│ │ ├── Button.as
│ │ ├── ButtonState.as
│ │ ├── Canvas.as
│ │ ├── DisplayObject.as
│ │ ├── DisplayObjectContainer.as
│ │ ├── Image.as
│ │ ├── Mesh.as
│ │ ├── MeshBatch.as
│ │ ├── MovieClip.as
│ │ ├── Quad.as
│ │ ├── Sprite.as
│ │ ├── Sprite3D.as
│ │ └── Stage.as
│ │ ├── errors
│ │ ├── AbstractClassError.as
│ │ ├── AbstractMethodError.as
│ │ ├── MissingContextError.as
│ │ └── NotSupportedError.as
│ │ ├── events
│ │ ├── EnterFrameEvent.as
│ │ ├── Event.as
│ │ ├── EventDispatcher.as
│ │ ├── KeyboardEvent.as
│ │ ├── ResizeEvent.as
│ │ ├── Touch.as
│ │ ├── TouchData.as
│ │ ├── TouchEvent.as
│ │ ├── TouchMarker.as
│ │ ├── TouchPhase.as
│ │ └── TouchProcessor.as
│ │ ├── filters
│ │ ├── BlurFilter.as
│ │ ├── ColorMatrixFilter.as
│ │ ├── CompositeFilter.as
│ │ ├── CompositeMode.as
│ │ ├── DisplacementMapFilter.as
│ │ ├── DropShadowFilter.as
│ │ ├── FilterChain.as
│ │ ├── FilterHelper.as
│ │ ├── FragmentFilter.as
│ │ ├── GlowFilter.as
│ │ └── IFilterHelper.as
│ │ ├── geom
│ │ └── Polygon.as
│ │ ├── rendering
│ │ ├── BatchProcessor.as
│ │ ├── BatchToken.as
│ │ ├── Effect.as
│ │ ├── FilterEffect.as
│ │ ├── IndexData.as
│ │ ├── MeshEffect.as
│ │ ├── Painter.as
│ │ ├── Program.as
│ │ ├── RenderState.as
│ │ ├── VertexData.as
│ │ ├── VertexDataAttribute.as
│ │ └── VertexDataFormat.as
│ │ ├── styles
│ │ ├── DistanceFieldStyle.as
│ │ └── MeshStyle.as
│ │ ├── text
│ │ ├── BitmapChar.as
│ │ ├── BitmapCharLocation.as
│ │ ├── BitmapFont.as
│ │ ├── BitmapFontType.as
│ │ ├── ITextCompositor.as
│ │ ├── MiniBitmapFont.as
│ │ ├── TextField.as
│ │ ├── TextFieldAutoSize.as
│ │ ├── TextFormat.as
│ │ ├── TextOptions.as
│ │ └── TrueTypeCompositor.as
│ │ ├── textures
│ │ ├── AtfData.as
│ │ ├── ConcretePotTexture.as
│ │ ├── ConcreteRectangleTexture.as
│ │ ├── ConcreteTexture.as
│ │ ├── ConcreteVideoTexture.as
│ │ ├── RenderTexture.as
│ │ ├── SubTexture.as
│ │ ├── Texture.as
│ │ ├── TextureAtlas.as
│ │ ├── TextureOptions.as
│ │ └── TextureSmoothing.as
│ │ └── utils
│ │ ├── Align.as
│ │ ├── AssetManager.as
│ │ ├── ButtonBehavior.as
│ │ ├── ByteArrayUtil.as
│ │ ├── Color.as
│ │ ├── Earcut.as
│ │ ├── MathUtil.as
│ │ ├── MatrixUtil.as
│ │ ├── MeshSubset.as
│ │ ├── MeshUtil.as
│ │ ├── Padding.as
│ │ ├── Pool.as
│ │ ├── RectangleUtil.as
│ │ ├── RenderUtil.as
│ │ ├── ScaleMode.as
│ │ ├── StringUtil.as
│ │ ├── SystemUtil.as
│ │ ├── deg2rad.as
│ │ ├── execute.as
│ │ └── rad2deg.as
└── starling.iml
├── tests
├── .vscode
│ └── launch.json
├── README.md
├── asconfig.json
├── fixtures
│ ├── atlas.xml
│ ├── audio.mp3
│ ├── data.txt
│ ├── font.xml
│ ├── image.atf
│ ├── image.gif
│ ├── image.jpg
│ ├── image.png
│ ├── invalid.json
│ ├── invalid.xml
│ ├── json.json
│ └── xml.xml
├── src
│ ├── Startup.as
│ ├── TestSuite.as
│ ├── UnitTest-app.xml
│ ├── starling
│ │ └── unit
│ │ │ ├── SimpleTestGui.as
│ │ │ ├── TestGui.as
│ │ │ ├── TestRunner.as
│ │ │ └── UnitTest.as
│ ├── tests
│ │ ├── animation
│ │ │ ├── DelayedCallTest.as
│ │ │ ├── JugglerTest.as
│ │ │ └── TweenTest.as
│ │ ├── assets
│ │ │ └── AssetManagerTest.as
│ │ ├── display
│ │ │ ├── BlendModeTest.as
│ │ │ ├── ButtonTest.as
│ │ │ ├── DisplayObjectContainerTest.as
│ │ │ ├── DisplayObjectTest.as
│ │ │ ├── ImageTest.as
│ │ │ ├── MeshTest.as
│ │ │ ├── MovieClipTest.as
│ │ │ ├── QuadTest.as
│ │ │ └── Sprite3DTest.as
│ │ ├── events
│ │ │ └── EventTest.as
│ │ ├── filters
│ │ │ ├── FilterChainTest.as
│ │ │ └── FragmentFilterTest.as
│ │ ├── geom
│ │ │ └── PolygonTest.as
│ │ ├── rendering
│ │ │ ├── IndexDataTest.as
│ │ │ ├── MeshStyleTest.as
│ │ │ ├── VertexDataFormatTest.as
│ │ │ └── VertexDataTest.as
│ │ ├── text
│ │ │ └── TextFieldTest.as
│ │ ├── textures
│ │ │ ├── TextureAtlasTest.as
│ │ │ └── TextureTest.as
│ │ └── utils
│ │ │ ├── ByteArrayUtilTest.as
│ │ │ ├── ColorTest.as
│ │ │ ├── MathUtilTest.as
│ │ │ ├── MatrixUtilTest.as
│ │ │ ├── RectangleUtilTest.as
│ │ │ ├── StringUtilTest.as
│ │ │ └── UtilsTest.as
│ └── utils
│ │ └── MockTexture.as
└── starling-tests.iml
└── util
├── field_agent
├── README.md
└── field_agent.rb
├── idea
├── .idea
│ ├── .gitignore
│ ├── idea.iml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── README.md
└── copy_resources.rb
├── ios_asset_project
├── README.md
├── iOS Asset Project.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── iOS Asset Project
│ ├── Assets.xcassets
│ ├── AccentColor.colorset
│ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x-1.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x-1.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x-1.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ ├── Icon-App-83.5x83.5@2x.png
│ │ └── ItunesArtwork@2x.png
│ ├── Contents.json
│ ├── logo.imageset
│ │ ├── Contents.json
│ │ ├── logo-1.png
│ │ └── logo.png
│ ├── splash_landscape.imageset
│ │ ├── Contents.json
│ │ ├── splash_landscape.png
│ │ ├── splash_landscape@2x.png
│ │ └── splash_landscape@3x.png
│ └── splash_portrait.imageset
│ │ ├── Contents.json
│ │ ├── splash_portrait.png
│ │ ├── splash_portrait@2x.png
│ │ └── splash_portrait@3x.png
│ ├── ContentView.swift
│ ├── Info.plist
│ ├── LaunchScreen.storyboard
│ └── iOS_Asset_ProjectApp.swift
└── transporter_chief
├── README.md
└── transporter_chief.rb
/.gitignore:
--------------------------------------------------------------------------------
1 | # =================================================================================================
2 | #
3 | # Starling Framework
4 | # Copyright Gamua GmbH. All Rights Reserved.
5 | #
6 | # This program is free software. You can redistribute and/or modify it
7 | # in accordance with the terms of the accompanying license agreement.
8 | #
9 | # =================================================================================================
10 |
11 | # Build and Release Folders
12 | bin-debug/
13 | bin-release/
14 | starling/doc/html/
15 | starling/bin/starling.swc
16 | tests/libs/
17 | out/
18 |
19 | # Eclipse / Flash Builder
20 | .settings/
21 | .flexProperties
22 | .FlexUnitSettings
23 | .actionScriptProperties
24 |
25 | # IntelliJ IDEA
26 | *.iws
27 | **/.idea/workspace.xml
28 | **/.idea/tasks.xml
29 | **/.idea/dictionaries
30 |
31 | # Visual Studio Code
32 | **/.vscode/settings.json
33 |
34 | # Xcode
35 | xcuserdata/
36 |
37 | # Gradle CI
38 | .gradle/
39 | build/
40 | !starling/build/
41 |
42 | # Maven CI
43 | target/
44 |
45 | # OS X folders
46 | .DS_Store
47 |
48 | # FlashBuilder auto generated test runners
49 | FlexUnitApplication.as
50 | FlexUnitCompilerApplication.as
51 |
52 | # Release package
53 | starling/bin/starling-*.zip
54 | starling/build/apm/*.airpackage
55 |
56 | # ANE dir
57 | samples/scaffold_mobile/lib/
58 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Simplified BSD License
2 | ======================
3 |
4 | Copyright 2011-2021 Gamua GmbH. All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without modification,
7 | are permitted provided that the following conditions are met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice, this list of
10 | conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 | of conditions and the following disclaimer in the documentation and/or other materials
14 | provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY GAMUA "AS IS" AND ANY EXPRESS OR IMPLIED
17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GAMUA OR
19 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
26 | The views and conclusions contained in the software and documentation are those of the
27 | authors and should not be interpreted as representing official policies, either expressed
28 | or implied, of Gamua.
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Starling Framework
2 |
3 | The Cross Platform Game Engine
4 | ------------------------------
5 |
6 | The Starling Framework allows you to create hardware accelerated apps in ActionScript 3. The main target is the creation of 2D games, but Starling may be used for any graphical application. Thanks to Adobe AIR, Starling-based applications can be deployed to mobile devices (iOS, Android) and the desktop (Windows, macOS).
7 |
8 | While Starling mimics the classic display tree architecture of Adobe AIR/Flash, it provides a much better performance: all objects are rendered directly by the GPU (using the Stage3D API). The complete architecture was designed for working well with the GPU; common game development tasks were built right into its core. Starling hides Stage3D internals from developers, but makes it easy to access them for those who need full performance and flexibility.
9 |
10 | Starling aims to be as lightweight and easy to use as possible. As an Open Source project, much care was taken to make the source code easy to read, understand and extend. With under 20k lines of code, experienced developers can easily grasp it in its entirety, or modify it to their needs.
11 |
12 | Quick Links
13 | -----------
14 |
15 | * [Official Homepage](http://www.starling-framework.org)
16 | * [Instruction Manual](http://manual.starling-framework.org)
17 | * [API Reference](http://doc.starling-framework.org)
18 | * [Support Forum](http://forum.starling-framework.org)
19 | * [Starling Wiki](http://wiki.starling-framework.org)
20 | * [Showcase](http://wiki.starling-framework.org/games/start)
21 | * [Extensions](http://wiki.starling-framework.org/extensions/start)
22 |
23 | News and Updates
24 | ----------------
25 |
26 | * [Twitter](https://twitter.com/gamua)
27 | * [Facebook](https://facebook.com/gamua.co)
28 | * [LinkedIn](https://www.linkedin.com/company/gamua)
29 |
30 | Adobe AIR – Provided by HARMAN
31 | ------------------------------
32 |
33 | * Get the latest AIR SDK [here](https://airsdk.harman.com).
34 |
--------------------------------------------------------------------------------
/samples/demo_mobile/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Debug (Android device)",
9 | "type": "swf",
10 | "request": "attach",
11 | "platform": "android",
12 | "connect": true,
13 | "preLaunchTask": "Adobe AIR: package Android debug - asconfig.json"
14 | },
15 | {
16 | "name": "Debug (iOS device)",
17 | "type": "swf",
18 | "request": "attach",
19 | "platform": "ios",
20 | "connect": true,
21 | "preLaunchTask": "Adobe AIR: package iOS debug - asconfig.json"
22 | },
23 | {
24 | "name": "Debug (AIR Simulator)",
25 | "type": "swf",
26 | "request": "launch",
27 | "profile": "mobileDevice",
28 | "screensize": "640x960:640x960", // iPhone 4S, a modern classic! ;)
29 | "screenDPI": 326,
30 | "versionPlatform": "IOS",
31 | "preLaunchTask": "ActionScript: compile debug - asconfig.json"
32 | },
33 | {
34 | "name": "Debug (iOS Simulator)",
35 | "type": "swf",
36 | "request": "attach",
37 | "platform": "ios_simulator",
38 | "preLaunchTask": "Adobe AIR: package iOS simulator debug - asconfig.json"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/README.md:
--------------------------------------------------------------------------------
1 | About this Demo
2 | ===============
3 |
4 | The mobile demo showcases some of the features of Starling. It runs on both iOS and Android devices.
5 |
6 | ## Building the project
7 |
8 | Users of "IntelliJ IDEA" can open the project that's stored in `starling/build/idea`.
9 | It has everything set up.
10 |
11 | Users of "Visual Studio Code" can run this demo like this:
12 |
13 | 1. Install the "ActionScript & MXML" extension from Josh Tynjala and point it to the latest AIR SDK.
14 | 2. Open the project folder in Visual Studio Code.
15 | 3. (Optional) To run on an actual device, adapt the "signingOptions" in `asconfig.json` so that they point to your local development keys from Apple and Google.
16 | 4. Enter the "Run and Debug" menu in the sidebar and start of one of the available configurations.
17 |
18 | All others, please refer to the documentation of their respective IDE.
19 |
--------------------------------------------------------------------------------
/samples/demo_mobile/asconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "config": "airmobile",
3 | "compilerOptions": {
4 | "output": "out/demo.swf",
5 | "source-path": [
6 | "src",
7 | "../../starling/src"
8 | ]
9 | },
10 | "mainClass": "Demo",
11 | "application": "src/Demo-app.xml",
12 | "airOptions": {
13 | "android": {
14 | "output": "out/demo.apk",
15 | "listen": true,
16 | "signingOptions": {
17 | "storetype": "JKS",
18 | "keystore": "../../../library/android/dev-key.keystore"
19 | },
20 | "resdir": "system/res"
21 | },
22 | "ios": {
23 | "output": "out/demo.ipa",
24 | "listen": true,
25 | "signingOptions": {
26 | "storetype": "pkcs12",
27 | "keystore": "../../../library/ios/daniel_dev_certificate.p12",
28 | "provisioning-profile": "../../../library/ios/ios_dev_profile.mobileprovision"
29 | }
30 | },
31 | "ios_simulator": {
32 | "output": "out/demo-simulator.ipa",
33 | "platformsdk": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
34 | "target": "ipa-debug-interpreter-simulator",
35 | "signingOptions": {
36 | "storetype": "pkcs12",
37 | "keystore": "../../../library/ios/daniel_dev_certificate.p12",
38 | "provisioning-profile": "../../../library/ios/ios_dev_profile.mobileprovision"
39 | }
40 | },
41 | "files": [
42 | {
43 | "file": "assets",
44 | "path": "assets"
45 | },
46 | {
47 | "file": "system",
48 | "path": ""
49 | }
50 | ]
51 | }
52 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/audio/wing_flap.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/audio/wing_flap.mp3
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/fonts/1x/desyrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/fonts/1x/desyrel.png
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/fonts/2x/desyrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/fonts/2x/desyrel.png
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/fonts/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/fonts/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/1x/atlas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/1x/atlas.png
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/1x/atlas.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/1x/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/1x/background.jpg
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/1x/compressed_texture.atf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/1x/compressed_texture.atf
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/2x/atlas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/2x/atlas.png
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/2x/atlas.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/2x/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/2x/background.jpg
--------------------------------------------------------------------------------
/samples/demo_mobile/assets/textures/2x/compressed_texture.atf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/assets/textures/2x/compressed_texture.atf
--------------------------------------------------------------------------------
/samples/demo_mobile/demo-mobile.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
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 |
--------------------------------------------------------------------------------
/samples/demo_mobile/src/Constants.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | public class Constants
4 | {
5 | public static const GameWidth:int = 320;
6 | public static const GameHeight:int = 480;
7 |
8 | public static const CenterX:int = GameWidth / 2;
9 | public static const CenterY:int = GameHeight / 2;
10 | }
11 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/Game.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import flash.system.System;
4 | import flash.ui.Keyboard;
5 | import flash.utils.getDefinitionByName;
6 |
7 | import scenes.Scene;
8 |
9 | import starling.assets.AssetManager;
10 | import starling.core.Starling;
11 | import starling.display.Button;
12 | import starling.display.DisplayObject;
13 | import starling.display.Image;
14 | import starling.display.Sprite;
15 | import starling.events.Event;
16 | import starling.events.KeyboardEvent;
17 |
18 | public class Game extends Sprite
19 | {
20 | // Embed the Ubuntu Font. Beware: the 'embedAsCFF'-part IS REQUIRED!!!
21 | [Embed(source="../assets/fonts/Ubuntu-R.ttf", embedAsCFF="false", fontFamily="Ubuntu")]
22 | private static const UbuntuRegular:Class;
23 |
24 | private var _mainMenu:MainMenu;
25 | private var _currentScene:Scene;
26 |
27 | private static var sAssets:AssetManager;
28 |
29 | public function Game()
30 | {
31 | // nothing to do here -- Startup will call "start" immediately.
32 | }
33 |
34 | public function start(assets:AssetManager):void
35 | {
36 | sAssets = assets;
37 | addChild(new Image(assets.getTexture("background")));
38 | showMainMenu();
39 |
40 | addEventListener(Event.TRIGGERED, onButtonTriggered);
41 | stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
42 | }
43 |
44 | private function showMainMenu():void
45 | {
46 | // now would be a good time for a clean-up
47 | System.pauseForGCIfCollectionImminent(0);
48 | System.gc();
49 |
50 | if (_mainMenu == null)
51 | _mainMenu = new MainMenu();
52 |
53 | addChild(_mainMenu);
54 | }
55 |
56 | private function onKey(event:KeyboardEvent):void
57 | {
58 | if (event.keyCode == Keyboard.SPACE)
59 | Starling.current.showStats = !Starling.current.showStats;
60 | else if (event.keyCode == Keyboard.X)
61 | Starling.context.dispose();
62 | }
63 |
64 | private function onButtonTriggered(event:Event):void
65 | {
66 | var button:DisplayObject = event.target as DisplayObject;
67 |
68 | if (button.name == "backButton")
69 | closeScene();
70 | else
71 | showScene(button.name);
72 | }
73 |
74 | private function closeScene():void
75 | {
76 | _currentScene.removeFromParent(true);
77 | _currentScene = null;
78 | showMainMenu();
79 | }
80 |
81 | private function showScene(name:String):void
82 | {
83 | if (_currentScene) return;
84 |
85 | var sceneClass:Class = getDefinitionByName(name) as Class;
86 | _currentScene = new sceneClass() as Scene;
87 | _mainMenu.removeFromParent();
88 | addChild(_currentScene);
89 | }
90 |
91 | public static function get assets():AssetManager { return sAssets; }
92 | }
93 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/BlendModeScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import starling.display.BlendMode;
4 | import starling.display.Button;
5 | import starling.display.Image;
6 | import starling.events.Event;
7 | import starling.text.TextField;
8 |
9 | import utils.MenuButton;
10 |
11 | public class BlendModeScene extends Scene
12 | {
13 | private var _button:Button;
14 | private var _image:Image;
15 | private var _infoText:TextField;
16 |
17 | private var _blendModes:Array = [
18 | BlendMode.NORMAL,
19 | BlendMode.MULTIPLY,
20 | BlendMode.SCREEN,
21 | BlendMode.ADD,
22 | BlendMode.ERASE,
23 | BlendMode.NONE
24 | ];
25 |
26 | public function BlendModeScene()
27 | {
28 | _button = new MenuButton("Switch Mode");
29 | _button.x = int(Constants.CenterX - _button.width / 2);
30 | _button.y = 15;
31 | _button.addEventListener(Event.TRIGGERED, onButtonTriggered);
32 | addChild(_button);
33 |
34 | _image = new Image(Game.assets.getTexture("starling_rocket"));
35 | _image.x = int(Constants.CenterX - _image.width / 2);
36 | _image.y = 170;
37 | addChild(_image);
38 |
39 | _infoText = new TextField(300, 32);
40 | _infoText.format.size = 19;
41 | _infoText.x = 10;
42 | _infoText.y = 330;
43 | addChild(_infoText);
44 |
45 | onButtonTriggered();
46 | }
47 |
48 | private function onButtonTriggered():void
49 | {
50 | var blendMode:String = _blendModes.shift() as String;
51 | _blendModes.push(blendMode);
52 |
53 | _infoText.text = blendMode;
54 | _image.blendMode = blendMode;
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/CustomHitTestScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import starling.events.Event;
4 | import starling.text.BitmapFont;
5 | import starling.text.TextField;
6 | import starling.utils.Align;
7 | import starling.utils.Color;
8 |
9 | import utils.RoundButton;
10 | import utils.TextButton;
11 |
12 | public class CustomHitTestScene extends Scene
13 | {
14 | public function CustomHitTestScene()
15 | {
16 | addInfoTextField(
17 | "Pushing the bird only works when the touch occurs within a circle." +
18 | "This can be accomplished by overriding the method 'hitTest'.", 15);
19 |
20 | // 'RoundButton' is a helper class of the Demo, not a part of Starling!
21 | // Have a look at its code to understand this example.
22 |
23 | var roundButton:RoundButton = new RoundButton(Game.assets.getTexture("starling_round"));
24 | roundButton.x = Constants.CenterX - int(roundButton.width / 2);
25 | roundButton.y = 85;
26 | addChild(roundButton);
27 |
28 | addInfoTextField(
29 | "The object below is created by combining a 'TextField' with a " +
30 | "'ButtonBehavior'. It acts just a like normal button, i.e. allowing " +
31 | "to abort a tap by moving away.", 270);
32 |
33 | // 'TextButton' is a helper class of the Demo, not a part of Starling!
34 | // Have a look at its code to understand this example.
35 |
36 | const texts:Array = [
37 | "Hold me!",
38 | "Thrill me.",
39 | "Kiss me!",
40 | "Kill me."
41 | ];
42 |
43 | var textButton:TextButton = new TextButton(115, 85, texts[0]);
44 | textButton.format.setTo("Desyrel", BitmapFont.NATIVE_SIZE, Color.WHITE);
45 | textButton.format.leading = -10;
46 | textButton.x = Constants.CenterX - int(textButton.width / 2);
47 | textButton.y = 340;
48 | addChild(textButton);
49 |
50 | var hitCount:int = 0;
51 | textButton.addEventListener(Event.TRIGGERED, function():void
52 | {
53 | textButton.text = texts[++hitCount % texts.length];
54 | });
55 | }
56 |
57 | private function addInfoTextField(text:String, y:Number):void
58 | {
59 | var infoText:TextField = new TextField(300, 100, text);
60 | infoText.x = 10;
61 | infoText.y = y;
62 | infoText.format.verticalAlign = Align.TOP;
63 | infoText.format.horizontalAlign = Align.CENTER;
64 | addChild(infoText);
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/MaskScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import flash.geom.Point;
4 |
5 | import starling.core.Starling;
6 | import starling.display.Canvas;
7 | import starling.display.Image;
8 | import starling.display.Quad;
9 | import starling.display.Sprite;
10 | import starling.events.Touch;
11 | import starling.events.TouchEvent;
12 | import starling.events.TouchPhase;
13 | import starling.filters.ColorMatrixFilter;
14 | import starling.text.TextField;
15 |
16 | public class MaskScene extends Scene
17 | {
18 | private var _contents:Sprite;
19 | private var _mask:Canvas;
20 | private var _maskDisplay:Canvas;
21 |
22 | public function MaskScene()
23 | {
24 | _contents = new Sprite();
25 | addChild(_contents);
26 |
27 | var stageWidth:Number = Starling.current.stage.stageWidth;
28 | var stageHeight:Number = Starling.current.stage.stageHeight;
29 |
30 | var touchQuad:Quad = new Quad(stageWidth, stageHeight);
31 | touchQuad.alpha = 0; // only used to get touch events
32 | addChildAt(touchQuad, 0);
33 |
34 | var image:Image = new Image(Game.assets.getTexture("flight_00"));
35 | image.x = (stageWidth - image.width) / 2;
36 | image.y = 80;
37 | _contents.addChild(image);
38 |
39 | // just to prove it works, use a filter on the image.
40 | var cm:ColorMatrixFilter = new ColorMatrixFilter();
41 | cm.adjustHue(-0.5);
42 | image.filter = cm;
43 |
44 | var maskText:TextField = new TextField(256, 128,
45 | "Move the mouse (or a finger) over the screen to move the mask.");
46 | maskText.x = (stageWidth - maskText.width) / 2;
47 | maskText.y = 260;
48 | maskText.format.size = 20;
49 | _contents.addChild(maskText);
50 |
51 | _maskDisplay = createCircle();
52 | _maskDisplay.alpha = 0.1;
53 | _maskDisplay.touchable = false;
54 | addChild(_maskDisplay);
55 |
56 | _mask = createCircle();
57 | _contents.mask = _mask;
58 |
59 | addEventListener(TouchEvent.TOUCH, onTouch);
60 | }
61 |
62 | private function onTouch(event:TouchEvent):void
63 | {
64 | var touch:Touch = event.getTouch(this, TouchPhase.HOVER) ||
65 | event.getTouch(this, TouchPhase.BEGAN) ||
66 | event.getTouch(this, TouchPhase.MOVED);
67 |
68 | if (touch)
69 | {
70 | var localPos:Point = touch.getLocation(this);
71 | _mask.x = _maskDisplay.x = localPos.x;
72 | _mask.y = _maskDisplay.y = localPos.y;
73 | }
74 | }
75 |
76 | private function createCircle():Canvas
77 | {
78 | var circle:Canvas = new Canvas();
79 | circle.beginFill(0xff0000);
80 | circle.drawCircle(0, 0, 100);
81 | circle.endFill();
82 | return circle;
83 | }
84 |
85 | }
86 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/MovieScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import flash.media.Sound;
4 |
5 | import starling.core.Starling;
6 | import starling.display.MovieClip;
7 | import starling.events.Event;
8 | import starling.textures.Texture;
9 |
10 | public class MovieScene extends Scene
11 | {
12 | private var _movie:MovieClip;
13 |
14 | public function MovieScene()
15 | {
16 | var frames:Vector. = Game.assets.getTextures("flight");
17 | _movie = new MovieClip(frames, 15);
18 |
19 | // add sounds
20 | var stepSound:Sound = Game.assets.getSound("wing_flap");
21 | _movie.setFrameSound(2, stepSound);
22 |
23 | // move the clip to the center and add it to the stage
24 | _movie.x = Constants.CenterX - int(_movie.width / 2);
25 | _movie.y = Constants.CenterY - int(_movie.height / 2);
26 | addChild(_movie);
27 |
28 | // like any animation, the movie needs to be added to the juggler!
29 | // this is the recommended way to do that.
30 | addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
31 | addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
32 | }
33 |
34 | private function onAddedToStage():void
35 | {
36 | Starling.juggler.add(_movie);
37 | }
38 |
39 | private function onRemovedFromStage():void
40 | {
41 | Starling.juggler.remove(_movie);
42 | }
43 |
44 | public override function dispose():void
45 | {
46 | removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
47 | removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
48 | super.dispose();
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/Scene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import flash.geom.Rectangle;
4 |
5 | import starling.display.Button;
6 | import starling.display.Sprite;
7 |
8 | import utils.MenuButton;
9 |
10 | public class Scene extends Sprite
11 | {
12 | private var _backButton:Button;
13 |
14 | public function Scene()
15 | {
16 | // the main menu listens for TRIGGERED events, so we just need to add the button.
17 | // (the event will bubble up when it's dispatched.)
18 |
19 | _backButton = new MenuButton("Back", 88, 50);
20 | _backButton.x = Constants.CenterX - _backButton.width / 2;
21 | _backButton.y = Constants.GameHeight - _backButton.height + 12;
22 | _backButton.name = "backButton";
23 | _backButton.textBounds.y -= 3;
24 | _backButton.readjustSize(); // forces textBounds to update
25 |
26 | addChild(_backButton);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/TextureScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import starling.display.Image;
4 | import starling.text.TextField;
5 | import starling.textures.Texture;
6 |
7 | public class TextureScene extends Scene
8 | {
9 | public function TextureScene()
10 | {
11 | // the flight textures are actually loaded from an atlas texture.
12 | // the "AssetManager" class wraps it away for us.
13 |
14 | var image1:Image = new Image(Game.assets.getTexture("flight_00"));
15 | image1.x = -20;
16 | image1.y = 0;
17 | addChild(image1);
18 |
19 | var image2:Image = new Image(Game.assets.getTexture("flight_04"));
20 | image2.x = 90;
21 | image2.y = 85;
22 | addChild(image2);
23 |
24 | var image3:Image = new Image(Game.assets.getTexture("flight_08"));
25 | image3.x = 100;
26 | image3.y = -60;
27 | addChild(image3);
28 |
29 | // display a compressed texture
30 |
31 | var compressedTexture:Texture = Game.assets.getTexture("compressed_texture");
32 | var image4:Image = new Image(compressedTexture);
33 | image4.x = Constants.CenterX - image4.width / 2;
34 | image4.y = 280;
35 | addChild(image4);
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/scenes/TouchScene.as:
--------------------------------------------------------------------------------
1 | package scenes
2 | {
3 | import starling.display.Image;
4 | import starling.text.TextField;
5 | import starling.utils.deg2rad;
6 |
7 | import utils.TouchSheet;
8 |
9 | public class TouchScene extends Scene
10 | {
11 | public function TouchScene()
12 | {
13 | var description:String = "[use Ctrl/Cmd & Shift to simulate multi-touch]";
14 |
15 | var infoText:TextField = new TextField(300, 25, description);
16 | infoText.x = infoText.y = 10;
17 | addChild(infoText);
18 |
19 | // to find out how to react to touch events have a look at the TouchSheet class!
20 | // It's part of the demo.
21 |
22 | var sheet:TouchSheet = new TouchSheet(new Image(Game.assets.getTexture("starling_sheet")));
23 | sheet.x = Constants.CenterX;
24 | sheet.y = Constants.CenterY;
25 | sheet.rotation = deg2rad(10);
26 | addChild(sheet);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/utils/MenuButton.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.geom.Rectangle;
4 |
5 | import starling.display.Button;
6 |
7 | /** A simple button that uses "scale9grid" with a single texture. */
8 | public class MenuButton extends Button
9 | {
10 | public function MenuButton(text:String, width:Number=128, height:Number=32)
11 | {
12 | super(Game.assets.getTexture("button"), text);
13 |
14 | this.scale9Grid = new Rectangle(12.5, 12.5, 20, 20);
15 | this.width = width;
16 | this.height = height;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/demo_mobile/src/utils/ProgressBar.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.display.GradientType;
4 | import flash.display.Shape;
5 | import flash.display.Sprite;
6 | import flash.geom.Matrix;
7 |
8 | public class ProgressBar extends Sprite
9 | {
10 | private var _background:Shape;
11 | private var _bar:Shape;
12 |
13 | public function ProgressBar(width:int, height:int)
14 | {
15 | init(width, height);
16 | }
17 |
18 | private function init(width:int, height:int):void
19 | {
20 | var padding:Number = height * 0.2;
21 | var cornerRadius:Number = padding * 2;
22 |
23 | // create black rounded box for background
24 |
25 | _background = new Shape();
26 | _background.graphics.beginFill(0x0, 0.5);
27 | _background.graphics.drawRoundRect(0, 0, width, height, cornerRadius, cornerRadius);
28 | _background.graphics.endFill();
29 | addChild(_background);
30 |
31 | // create progress bar shape
32 |
33 | var barWidth:Number = width - 2 * padding;
34 | var barHeight:Number = height - 2 * padding;
35 | var barMatrix:Matrix = new Matrix();
36 | barMatrix.createGradientBox(barWidth, barHeight, Math.PI / 2);
37 |
38 | _bar = new Shape();
39 | _bar.graphics.beginGradientFill(GradientType.LINEAR,
40 | [0xeeeeee, 0xaaaaaa], [1, 1], [0, 255], barMatrix);
41 | _bar.graphics.drawRect(0, 0, barWidth, barHeight);
42 | _bar.x = padding;
43 | _bar.y = padding;
44 | _bar.scaleX = 0.0;
45 | addChild(_bar);
46 | }
47 |
48 | public function get ratio():Number { return _bar.scaleX; }
49 | public function set ratio(value:Number):void
50 | {
51 | _bar.scaleX = Math.max(0.0, Math.min(1.0, value));
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/utils/RoundButton.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.geom.Point;
4 | import flash.geom.Rectangle;
5 |
6 | import starling.display.Button;
7 | import starling.display.DisplayObject;
8 | import starling.textures.Texture;
9 |
10 | public class RoundButton extends Button
11 | {
12 | public function RoundButton(upState:Texture, text:String="", downState:Texture=null)
13 | {
14 | super(upState, text, downState);
15 | }
16 |
17 | public override function hitTest(localPoint:Point):DisplayObject
18 | {
19 | // When the user touches the screen, this method is used to find out if an object was
20 | // hit. By default, this method uses the bounding box, but by overriding it,
21 | // we can change the box (rectangle) to a circle (or whatever necessary).
22 |
23 | // these are the cases in which a hit test must always fail
24 | if (!visible || !touchable || !hitTestMask(localPoint)) return null;
25 |
26 | // get center of button
27 | var bounds:Rectangle = this.bounds;
28 | var centerX:Number = bounds.width / 2;
29 | var centerY:Number = bounds.height / 2;
30 |
31 | // calculate distance of localPoint to center.
32 | // we keep it squared, since we want to avoid the 'sqrt()'-call.
33 | var sqDist:Number = Math.pow(localPoint.x - centerX, 2) +
34 | Math.pow(localPoint.y - centerY, 2);
35 |
36 | // when the squared distance is smaller than the squared radius,
37 | // the point is inside the circle
38 | var radius:Number = bounds.width / 2 - 8;
39 | if (sqDist < Math.pow(radius, 2)) return this;
40 | else return null;
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/samples/demo_mobile/src/utils/TextButton.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.geom.Point;
4 |
5 | import starling.display.ButtonState;
6 | import starling.display.DisplayObject;
7 | import starling.text.TextField;
8 | import starling.text.TextFormat;
9 | import starling.text.TextOptions;
10 | import starling.utils.ButtonBehavior;
11 |
12 | /** This class shows how to use "ButtonBehavior": you add the behavior as instance member
13 | * and react to state changes in a custom callback. Furthermore, you forward hit tests.
14 | * As a result, the class will dispatch "TRIGGERED" events and will allow users to cancel
15 | * the touch by moving away the finger before lifting it.
16 | */
17 | public class TextButton extends TextField
18 | {
19 | private var _behavior:ButtonBehavior;
20 | private var _tint:uint = 0xffc0ff;
21 |
22 | public function TextButton(width:int, height:int, text:String="",
23 | format:TextFormat=null, options:TextOptions=null)
24 | {
25 | super(width, height, text, format, options);
26 |
27 | _behavior = new ButtonBehavior(this, onStateChange);
28 |
29 | batchable = true;
30 | }
31 |
32 | private function onStateChange(state:String):void
33 | {
34 | if (state == ButtonState.DOWN)
35 | format.color = _tint;
36 | else
37 | format.color = 0xffffff;
38 | }
39 |
40 | public override function hitTest(localPoint:Point):DisplayObject
41 | {
42 | return _behavior.hitTest(localPoint);
43 | }
44 |
45 | public function get tint():uint { return _tint; }
46 | public function set tint(value:uint):void { _tint = value; }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/samples/demo_mobile/system/Assets.car:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/Assets.car
--------------------------------------------------------------------------------
/samples/demo_mobile/system/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
--------------------------------------------------------------------------------
/samples/demo_mobile/system/LaunchScreen.storyboardc/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/LaunchScreen.storyboardc/Info.plist
--------------------------------------------------------------------------------
/samples/demo_mobile/system/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
--------------------------------------------------------------------------------
/samples/demo_mobile/system/icon114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/icon114.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/icon144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/icon144.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/icon57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/icon57.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/icon72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/icon72.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-hdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-hdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-hdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-hdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-hdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-hdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-mdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-mdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-mdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-mdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-mdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-mdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xhdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxhdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/demo_mobile/system/res/mipmap-xxxhdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/demo_web/README.md:
--------------------------------------------------------------------------------
1 | > **NOTE:** This source is for targetting Flash Player. While Flash Player itself is no longer available, this source is provided for archival reason, as it can be useful reference for people working on Flash Player emulators like Ruffle or AwayFL and as reference for people making content targetting said emulators.
2 |
3 | How to build this Sample
4 | ========================
5 |
6 | The web demo shows some of the features of Starling. It can be run via the Flash plugin.
7 |
8 | This folder contains just the Startup-code. The rest of the code, as well as the assets, are found in the "demo" folder, and needs to be referenced in your project.
9 |
10 | If you are working with Flash Builder, you can import the project using "File - Import Flash Builder Project". However, the project requires you to set up an Eclipse workspace path pointing to Starling. To do that, enter "Preferences - General - Workspace - Linked Resources" and add a new path variable called STARLING_FRAMEWORK that points to the root of the Starling-Framework directory.
11 |
12 | If you are using another IDE, it might unfortunately be a little more complicated. You have to create a project that is based in this folder and add the following source paths to your project:
13 |
14 | * '../demo_mobile/src' -> the actual code of the demo
15 | * '../demo_mobile/media' -> the assets of the demo
16 | * '../demo_mobile/system' -> the system graphics (icons, launch images) of the demo
17 |
18 | Starling itself can either be linked via a source path, or by referencing its swc file.
19 |
20 | If your IDE doesn't allow adding source paths outside the project root, I recommend you create a new folder where you manually merge the "demo" and "demo_web" folders together. Then add just the "media" and "system" folders to your source paths (that's required so that the "Embed" statements can find them).
21 |
--------------------------------------------------------------------------------
/samples/demo_web/asconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "output": "bin-debug/Demo_Web.swf",
4 | "source-path": [
5 | "src",
6 | "../demo_mobile/src",
7 | "../demo_mobile/assets",
8 | "../demo_mobile/system",
9 | "../../starling/src"
10 | ]
11 | },
12 | "mainClass": "Demo_Web_Preloader",
13 | "copySourcePathAssets": false,
14 | "additionalOptions": "-locale en_US -frame StartupFrame Demo_Web"
15 | }
--------------------------------------------------------------------------------
/samples/demo_web/src/EmbeddedAssets.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | public class EmbeddedAssets
4 | {
5 | /** ATTENTION: Naming conventions!
6 | *
7 | * - Classes for embedded IMAGES should have the exact same name as the file,
8 | * without extension. This is required so that references from XMLs (atlas, bitmap font)
9 | * won't break.
10 | *
11 | * - Atlas and Font XML files can have an arbitrary name, since they are never
12 | * referenced by file name.
13 | *
14 | */
15 |
16 | // Texture Atlas
17 |
18 | [Embed(source="../../demo_mobile/assets/textures/1x/atlas.xml", mimeType="application/octet-stream")]
19 | public static const atlas_xml:Class;
20 |
21 | [Embed(source="../../demo_mobile/assets/textures/1x/atlas.png")]
22 | public static const atlas:Class;
23 |
24 | // Bitmap textures
25 |
26 | [Embed(source="../../demo_mobile/assets/textures/1x/background.jpg")]
27 | public static const background:Class;
28 |
29 | // Compressed textures
30 |
31 | [Embed(source = "../../demo_mobile/assets/textures/1x/compressed_texture.atf", mimeType="application/octet-stream")]
32 | public static const compressed_texture:Class;
33 |
34 | // Bitmap Fonts
35 |
36 | [Embed(source="../../demo_mobile/assets/fonts/1x/desyrel.fnt", mimeType="application/octet-stream")]
37 | public static const desyrel_fnt:Class;
38 |
39 | [Embed(source = "../../demo_mobile/assets/fonts/1x/desyrel.png")]
40 | public static const desyrel:Class;
41 |
42 | // Sounds
43 |
44 | [Embed(source="../../demo_mobile/assets/audio/wing_flap.mp3")]
45 | public static const wing_flap:Class;
46 | }
47 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Debug (Android device)",
9 | "type": "swf",
10 | "request": "attach",
11 | "platform": "android",
12 | "connect": true,
13 | "preLaunchTask": "Adobe AIR: package Android debug - asconfig.json"
14 | },
15 | {
16 | "name": "Debug (iOS device)",
17 | "type": "swf",
18 | "request": "attach",
19 | "platform": "ios",
20 | "connect": true,
21 | "preLaunchTask": "Adobe AIR: package iOS debug - asconfig.json"
22 | },
23 | {
24 | "name": "Debug (AIR Simulator)",
25 | "type": "swf",
26 | "request": "launch",
27 | "profile": "mobileDevice",
28 | "screensize": "375x667:375x667", // low-res iPhone 8 ;)
29 | "screenDPI": 163,
30 | "versionPlatform": "IOS",
31 | "preLaunchTask": "ActionScript: compile debug - asconfig.json"
32 | },
33 | {
34 | "name": "Debug (iOS Simulator)",
35 | "type": "swf",
36 | "request": "attach",
37 | "platform": "ios_simulator",
38 | "preLaunchTask": "Adobe AIR: package iOS simulator debug - asconfig.json"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/asconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "config": "airmobile",
3 | "compilerOptions": {
4 | "output": "out/scaffold.swf",
5 | "source-path": [
6 | "src",
7 | "../../starling/src"
8 | ]
9 | // Add each of your ANEs here. Don't forget to enable 'extdir' below, as well!
10 | // "library-path": [
11 | // "lib/androidx.core.ane",
12 | // "lib/com.distriqt.Application.ane",
13 | // "lib/com.distriqt.Core.ane"
14 | // ]
15 | },
16 | "mainClass": "Scaffold",
17 | "application": "src/Scaffold-app.xml",
18 | "airOptions": {
19 | "android": {
20 | "output": "out/scaffold.apk",
21 | "listen": true,
22 | "signingOptions": {
23 | "storetype": "JKS",
24 | "keystore": "../../../library/android/dev-key.keystore"
25 | },
26 | "resdir": "system/res"
27 | },
28 | "ios": {
29 | "output": "out/scaffold.ipa",
30 | "listen": true,
31 | "signingOptions": {
32 | "storetype": "pkcs12",
33 | "keystore": "../../../library/ios/daniel_dev_certificate.p12",
34 | "provisioning-profile": "../../../library/ios/ios_dev_profile.mobileprovision"
35 | }
36 | },
37 | "ios_simulator": {
38 | "output": "out/scaffold-simulator.ipa",
39 | "platformsdk": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
40 | "target": "ipa-debug-interpreter-simulator",
41 | "signingOptions": {
42 | "storetype": "pkcs12",
43 | "keystore": "../../../library/ios/daniel_dev_certificate.p12",
44 | "provisioning-profile": "../../../library/ios/ios_dev_profile.mobileprovision"
45 | }
46 | },
47 | // Specify the directory where your ANEs are located.
48 | // "extdir": [
49 | // "lib"
50 | // ],
51 | "files": [
52 | {
53 | "file": "assets",
54 | "path": "assets"
55 | },
56 | {
57 | "file": "system",
58 | "path": ""
59 | }
60 | ]
61 | }
62 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/audio/click.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/audio/click.mp3
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/fonts/1x/desyrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/fonts/1x/desyrel.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/fonts/2x/desyrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/fonts/2x/desyrel.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/fonts/Ubuntu-R.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/fonts/Ubuntu-R.ttf
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/1x/atlas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/textures/1x/atlas.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/1x/atlas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/1x/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/textures/1x/logo.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/2x/atlas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/textures/2x/atlas.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/2x/atlas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/assets/textures/2x/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/assets/textures/2x/logo.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/scaffold-mobile.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/Game.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import starling.animation.Transitions;
4 | import starling.core.Starling;
5 | import starling.display.Image;
6 | import starling.events.TouchEvent;
7 | import starling.events.TouchPhase;
8 | import starling.utils.deg2rad;
9 |
10 | /** The Game class represents the actual game. In this scaffold, it just displays a
11 | * Starling that moves around fast. When the user touches the Starling, the game ends. */
12 | public class Game extends Scene
13 | {
14 | public static const GAME_OVER:String = "gameOver";
15 |
16 | private var _bird:Image;
17 | private var _tweenID:uint = 0;
18 |
19 | public function Game()
20 | { }
21 |
22 | override public function init():void
23 | {
24 | // Set up objects. 'this.stage' is available, but we don't know the scene size yet.
25 |
26 | _bird = new Image(Root.assets.getTexture("starling_rocket"));
27 | _bird.pivotX = _bird.width / 2;
28 | _bird.pivotY = _bird.height / 2;
29 | _bird.addEventListener(TouchEvent.TOUCH, onBirdTouched);
30 | addChild(_bird);
31 | }
32 |
33 | override public function updatePositions():void
34 | {
35 | // Set up positions.
36 | // => When this method is called, "sceneWidth" and "sceneHeight" are already set.
37 | // => They indicate the available "safe area".
38 |
39 | _bird.x = sceneWidth / 2.0;
40 | _bird.y = sceneHeight / 2.0;
41 | if (_tweenID == 0) moveBird();
42 | }
43 |
44 | private function moveBird():void
45 | {
46 | var scale:Number = Math.random() * 0.8 + 0.2;
47 | _tweenID = Starling.juggler.tween(_bird, Math.random() * 0.5 + 0.5, {
48 | x: Math.random() * sceneWidth,
49 | y: Math.random() * sceneHeight,
50 | scaleX: scale,
51 | scaleY: scale,
52 | rotation: Math.random() * deg2rad(180) - deg2rad(90),
53 | transition: Transitions.EASE_IN_OUT,
54 | onComplete: moveBird
55 | });
56 | }
57 |
58 | private function onBirdTouched(event:TouchEvent):void
59 | {
60 | if (event.getTouch(_bird, TouchPhase.BEGAN))
61 | {
62 | Root.assets.playSound("click");
63 | Starling.juggler.removeTweens(_bird);
64 | dispatchEventWith(GAME_OVER, true, 100);
65 | }
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/Menu.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import starling.events.Event;
4 | import starling.text.BitmapFont;
5 | import starling.text.TextField;
6 |
7 | import utils.MenuButton;
8 |
9 | /** The Menu shows the logo of the game and a start button that will, once triggered,
10 | * start the actual game. In a real game, it will probably contain several buttons and
11 | * link to several screens (e.g. a settings screen or the credits). If your menu contains
12 | * a lot of logic, you could use the "Feathers" library to make your life easier. */
13 | public class Menu extends Scene
14 | {
15 | public static const START_GAME:String = "startGame";
16 |
17 | private var _textField:TextField;
18 | private var _menuButton:MenuButton;
19 |
20 | public function Menu()
21 | { }
22 |
23 | override public function init():void
24 | {
25 | // Set up objects. 'this.stage' is available, but we don't know the scene size yet.
26 |
27 | _textField = new TextField(250, 50, "Game Scaffold");
28 | _textField.format.setTo("Desyrel", BitmapFont.NATIVE_SIZE, 0xffffff);
29 | addChild(_textField);
30 |
31 | _menuButton = new MenuButton("Start", 150, 40);
32 | _menuButton.textFormat.setTo("Ubuntu", 16);
33 | _menuButton.addEventListener(Event.TRIGGERED, onButtonTriggered);
34 | addChild(_menuButton);
35 | }
36 |
37 | override public function updatePositions():void
38 | {
39 | // Set up positions.
40 | // => When this method is called, "sceneWidth" and "sceneHeight" are set.
41 |
42 | _textField.x = (sceneWidth - _textField.width) / 2;
43 | _textField.y = sceneHeight * 0.1;
44 |
45 | _menuButton.x = (sceneWidth - _menuButton.width) / 2;
46 | _menuButton.y = sceneHeight * 0.9 - _menuButton.height;
47 | }
48 |
49 | private function onButtonTriggered():void
50 | {
51 | dispatchEventWith(START_GAME, true, "classic");
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/Scene.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package
12 | {
13 | import starling.display.Sprite;
14 |
15 | /** A Scene represents a full-screen, high-level element of your game.
16 | * The "Menu" and "Game" classes inherit from this class.
17 | * The "Root" class allows you to navigate between scene objects.
18 | */
19 | public class Scene extends Sprite
20 | {
21 | private var _sceneWidth:Number;
22 | private var _sceneHeight:Number;
23 |
24 | /** Initializes all its display objects.
25 | * When this method is called, the scene is already connected to the stage. */
26 | public function init():void
27 | {}
28 |
29 | /** Called once after 'init', and then again when the device orientation changes.
30 | * (e.g. from portrait to landscape). Override in subclasses! */
31 | public function updatePositions():void
32 | {}
33 |
34 | /** Called by 'Root' when the size changes.
35 | * 'width' and 'height' indicate the safe area size (screen minus cutouts). */
36 | public function setSize(width:Number, height:Number):void
37 | {
38 | _sceneWidth = width;
39 | _sceneHeight = height;
40 | updatePositions();
41 | }
42 |
43 | public function get sceneWidth():Number { return _sceneWidth; }
44 | public function get sceneHeight():Number { return _sceneHeight; }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/utils/MenuButton.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.geom.Rectangle;
4 |
5 | import starling.display.Button;
6 |
7 | /** A simple button that uses "scale9grid" with a single texture. */
8 | public class MenuButton extends Button
9 | {
10 | public function MenuButton(text:String, width:Number=128, height:Number=32)
11 | {
12 | super(Root.assets.getTexture("button"), text);
13 |
14 | this.scale9Grid = new Rectangle(12.5, 12.5, 20, 20);
15 | this.width = width;
16 | this.height = height;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/utils/ProgressBar.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.display.GradientType;
4 | import flash.display.Shape;
5 | import flash.display.Sprite;
6 | import flash.geom.Matrix;
7 |
8 | public class ProgressBar extends Sprite
9 | {
10 | private var _background:Shape;
11 | private var _bar:Shape;
12 |
13 | public function ProgressBar(width:int, height:int)
14 | {
15 | init(width, height);
16 | }
17 |
18 | private function init(width:int, height:int):void
19 | {
20 | var padding:Number = height * 0.2;
21 | var cornerRadius:Number = padding * 2;
22 |
23 | // create black rounded box for background
24 |
25 | _background = new Shape();
26 | _background.graphics.beginFill(0x0, 0.5);
27 | _background.graphics.drawRoundRect(0, 0, width, height, cornerRadius, cornerRadius);
28 | _background.graphics.endFill();
29 | addChild(_background);
30 |
31 | // create progress bar shape
32 |
33 | var barWidth:Number = width - 2 * padding;
34 | var barHeight:Number = height - 2 * padding;
35 | var barMatrix:Matrix = new Matrix();
36 | barMatrix.createGradientBox(barWidth, barHeight, Math.PI / 2);
37 |
38 | _bar = new Shape();
39 | _bar.graphics.beginGradientFill(GradientType.LINEAR,
40 | [0xeeeeee, 0xaaaaaa], [1, 1], [0, 255], barMatrix);
41 | _bar.graphics.drawRect(0, 0, barWidth, barHeight);
42 | _bar.x = padding;
43 | _bar.y = padding;
44 | _bar.scaleX = 0.0;
45 | addChild(_bar);
46 | }
47 |
48 | public function get ratio():Number { return _bar.scaleX; }
49 | public function set ratio(value:Number):void
50 | {
51 | _bar.scaleX = Math.max(0.0, Math.min(1.0, value));
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/samples/scaffold_mobile/src/utils/SafeAreaOverlay.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import starling.display.DisplayObjectContainer;
4 | import starling.display.Quad;
5 | import starling.text.BitmapFont;
6 | import starling.text.TextField;
7 | import starling.utils.Align;
8 |
9 | public class SafeAreaOverlay extends DisplayObjectContainer
10 | {
11 | private var _topLeft:TextField;
12 | private var _bottomRight:TextField;
13 | private var _overlay:Quad;
14 |
15 | public function SafeAreaOverlay(color:uint = 0xff0000, alpha:Number = 0.1)
16 | {
17 | _overlay = new Quad(200, 200, color);
18 | _overlay.alpha = alpha;
19 |
20 | _topLeft = new TextField(100, 15, "top left");
21 | _topLeft.format.setTo(BitmapFont.MINI, BitmapFont.NATIVE_SIZE, 0x0, Align.LEFT, Align.TOP);
22 |
23 | _bottomRight = new TextField(100, 15, "bottom right");
24 | _bottomRight.format.setTo(BitmapFont.MINI, BitmapFont.NATIVE_SIZE, 0x0, Align.RIGHT, Align.BOTTOM);
25 | _bottomRight.alignPivot(Align.RIGHT, Align.BOTTOM);
26 |
27 | addChild(_overlay);
28 | addChild(_topLeft);
29 | addChild(_bottomRight);
30 |
31 | touchable = false;
32 | }
33 |
34 | public function setSize(width:Number, height:Number):void
35 | {
36 | _overlay.width = width;
37 | _overlay.height = height;
38 | _bottomRight.x = width;
39 | _bottomRight.y = height;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/Assets.car:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/Assets.car
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/LaunchScreen.storyboardc/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/LaunchScreen.storyboardc/Info.plist
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/icon114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/icon114.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/icon144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/icon144.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/icon57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/icon57.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/icon72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/icon72.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-hdpi/icon.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-hdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-mdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xhdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxhdpi/icon_round.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_background.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_foreground.png
--------------------------------------------------------------------------------
/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/samples/scaffold_mobile/system/res/mipmap-xxxhdpi/icon_round.png
--------------------------------------------------------------------------------
/starling/asconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "lib",
3 | "config": "air",
4 | "compilerOptions": {
5 | "output": "bin-debug/starling.swc",
6 | "source-path": [
7 | "src"
8 | ],
9 | "include-sources": [
10 | "src"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/starling/bin/README.md:
--------------------------------------------------------------------------------
1 | The repository no longer contains a binary version of Starling.
2 | Beginning with version 2, the SWC files are part of the release downloads found on GitHub:
3 |
4 | https://github.com/Gamua/Starling-Framework/releases
--------------------------------------------------------------------------------
/starling/build/ant/build.properties:
--------------------------------------------------------------------------------
1 | # basic properties
2 | version = 2.7
3 | src.dir = ${basedir}/src
4 | deploy.dir = ${basedir}/bin
5 | doc.dir = ${basedir}/doc/html
6 | shared.dir = ${basedir}/build/shared
7 | swf.version = 40
8 |
9 | # location of the AIR SDK
10 | airsdk.root = /Users/redge/Dropbox/Development/library/air/sdks/air-33
11 | airsdk.bin = ${airsdk.root}/bin
12 | airsdk.lib = ${airsdk.root}/lib
13 | airsdk.config = ${airsdk.root}/frameworks/flex-config.xml
14 | airsdk.framework = ${airsdk.root}/frameworks
15 |
16 | # path to compiler jars
17 | asdoc = ${airsdk.lib}/legacy/asdoc.jar
18 | compc = ${airsdk.lib}/compc-cli.jar
19 | mxmlc = ${airsdk.lib}/mxmlc-cli.jar
20 | adt = ${airsdk.lib}/adt.jar
21 |
22 | # misc
23 | footer.text = Starling Framework | Github Project | Support Forum
--------------------------------------------------------------------------------
/starling/build/idea/.idea/.name:
--------------------------------------------------------------------------------
1 | starling-framework
--------------------------------------------------------------------------------
/starling/build/idea/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/flexCompiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/starling/build/idea/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/starling/build/idea/README.md:
--------------------------------------------------------------------------------
1 | This folder contains a hidden ".idea" directory with an IntelliJ-IDEA project. That project references all modules that are part of the Starling download (i.e. Starling itself and the sample projects).
2 |
3 | To run any of the samples in the ADL simulator, you will need to configure two external tools. To find out how to do that, have a look at the folder "util/idea".
--------------------------------------------------------------------------------
/starling/build/shared/package-descriptions.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/starling/doc/.gitignore:
--------------------------------------------------------------------------------
1 | upload.sh
--------------------------------------------------------------------------------
/starling/doc/generate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # This script creates the API reference documentation for the Starling source.
4 | # It uses the "ASDoc" tool that comes with the AIR SDK.
5 | # Adapt the ASDOC variable below so that it points to the correct path.
6 |
7 | if [ $# -ne 1 ]
8 | then
9 | echo "Usage: `basename $0` [version]"
10 | echo " (version like '1.0')"
11 | exit 1
12 | fi
13 |
14 | ASDOC="/Users/redge/Dropbox/Development/library/air/sdks/air-33/bin/asdoc"
15 |
16 | "${ASDOC}" \
17 | -doc-sources ../src \
18 | -exclude-classes com.adobe.utils.AGALMiniAssembler \
19 | -main-title "Starling Framework Reference (v$version)" \
20 | -window-title "Starling Framework Reference" \
21 | -package-description-file "../build/shared/package-descriptions.xml" \
22 | -strict=false \
23 | -output html
24 |
--------------------------------------------------------------------------------
/starling/src/starling/animation/IAnimatable.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.animation
12 | {
13 | /** The IAnimatable interface describes objects that are animated depending on the passed time.
14 | * Any object that implements this interface can be added to a juggler.
15 | *
16 | *
When an object should no longer be animated, it has to be removed from the juggler.
17 | * To do this, you can manually remove it via the method juggler.remove(object),
18 | * or the object can request to be removed by dispatching a Starling event with the type
19 | * Event.REMOVE_FROM_JUGGLER. The "Tween" class is an example of a class that
20 | * dispatches such an event; you don't have to remove tweens manually from the juggler.
21 | *
22 | * @see Juggler
23 | * @see Tween
24 | */
25 | public interface IAnimatable
26 | {
27 | /** Advance the time by a number of seconds. @param time in seconds. */
28 | function advanceTime(time:Number):void;
29 | }
30 | }
--------------------------------------------------------------------------------
/starling/src/starling/assets/AssetReference.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import starling.textures.TextureOptions;
4 |
5 | /** The description of an asset to be created by an AssetFactory. */
6 | public class AssetReference
7 | {
8 | private var _name:String;
9 | private var _url:String;
10 | private var _data:Object;
11 | private var _mimeType:String;
12 | private var _extension:String;
13 | private var _textureOptions:TextureOptions;
14 |
15 | /** Creates a new instance with the given data, which is typically some kind of file
16 | * reference / URL or an instance of an asset class. If 'data' contains an URL, an
17 | * equivalent value will be assigned to the 'url' property. */
18 | public function AssetReference(data:Object)
19 | {
20 | _data = data;
21 | _textureOptions = new TextureOptions();
22 |
23 | if (data is String) _url = data as String;
24 | else if ("url" in data) _url = data["url"] as String;
25 | }
26 |
27 | /** The name with which the asset should be added to the AssetManager. */
28 | public function get name():String { return _name; }
29 | public function set name(value:String):void { _name = value; }
30 |
31 | /** The url from which the asset needs to be / has been loaded. */
32 | public function get url():String { return _url; }
33 | public function set url(value:String):void { _url = value; }
34 |
35 | /** The raw data of the asset. This property often contains an URL; when it's passed
36 | * to an AssetFactory, loading has already completed, and the property contains a
37 | * ByteArray with the loaded data. */
38 | public function get data():Object { return _data; }
39 | public function set data(value:Object):void { _data = value; }
40 |
41 | /** The mime type of the asset, if loaded from a server. */
42 | public function get mimeType():String { return _mimeType; }
43 | public function set mimeType(value:String):void { _mimeType = value; }
44 |
45 | /** The file extension of the asset, if the filename or URL contains one. */
46 | public function get extension():String { return _extension; }
47 | public function set extension(value:String):void { _extension = value; }
48 |
49 | /** The TextureOptions describing how to create a texture, if the asset references one. */
50 | public function get textureOptions():TextureOptions { return _textureOptions; }
51 | public function set textureOptions(value:TextureOptions):void
52 | {
53 | _textureOptions.copyFrom(value);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/starling/src/starling/assets/AssetType.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import flash.media.Sound;
4 | import flash.media.Video;
5 | import flash.utils.ByteArray;
6 |
7 | import starling.errors.AbstractClassError;
8 | import starling.text.BitmapFont;
9 | import starling.textures.Texture;
10 | import starling.textures.TextureAtlas;
11 |
12 | /** An enumeration class containing all the asset types supported by the AssetManager. */
13 | public class AssetType
14 | {
15 | /** @private */
16 | public function AssetType() { throw new AbstractClassError(); }
17 |
18 | public static const TEXTURE:String = "texture";
19 | public static const TEXTURE_ATLAS:String = "textureAtlas";
20 | public static const SOUND:String = "sound";
21 | public static const XML_DOCUMENT:String = "xml";
22 | public static const OBJECT:String = "object";
23 | public static const BYTE_ARRAY:String = "byteArray";
24 | public static const BITMAP_FONT:String = "bitmapFont";
25 | public static const ASSET_MANAGER:String = "assetManager";
26 |
27 | /** Figures out the asset type string from the type of the given instance. */
28 | public static function fromAsset(asset:Object):String
29 | {
30 | if (asset is Texture) return TEXTURE;
31 | else if (asset is TextureAtlas) return TEXTURE_ATLAS;
32 | else if (asset is Sound) return SOUND;
33 | else if (asset is XML) return XML_DOCUMENT;
34 | else if (asset is ByteArray) return BYTE_ARRAY;
35 | else if (asset is BitmapFont) return BITMAP_FONT;
36 | else if (asset is AssetManager) return ASSET_MANAGER;
37 | else return OBJECT;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/starling/src/starling/assets/AtfTextureFactory.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | import starling.textures.AtfData;
6 | import starling.textures.Texture;
7 | import starling.utils.execute;
8 |
9 | /** This AssetFactory creates texture assets from ATF files. */
10 | public class AtfTextureFactory extends AssetFactory
11 | {
12 | /** Creates a new instance. */
13 | public function AtfTextureFactory()
14 | {
15 | addExtensions("atf"); // not used, actually, since we can parse the ATF header, anyway.
16 | }
17 |
18 | /** @inheritDoc */
19 | override public function canHandle(reference:AssetReference):Boolean
20 | {
21 | return (reference.data is ByteArray && AtfData.isAtfData(reference.data as ByteArray));
22 | }
23 |
24 | /** @inheritDoc */
25 | override public function create(reference:AssetReference, helper:AssetFactoryHelper,
26 | onComplete:Function, onError:Function):void
27 | {
28 | helper.executeWhenContextReady(createTexture);
29 |
30 | function createTexture():void
31 | {
32 | var onReady:Function = reference.textureOptions.onReady as Function;
33 | reference.textureOptions.onReady = function():void
34 | {
35 | execute(onReady, texture);
36 | onComplete(reference.name, texture);
37 | };
38 |
39 | var texture:Texture = null;
40 | var url:String = reference.url;
41 |
42 | try { texture = Texture.fromData(reference.data, reference.textureOptions); }
43 | catch (e:Error) { onError(e.message); }
44 |
45 | if (url && texture)
46 | {
47 | texture.root.onRestore = function():void
48 | {
49 | helper.onBeginRestore();
50 | helper.loadDataFromUrl(url, function(data:ByteArray):void
51 | {
52 | helper.executeWhenContextReady(function():void
53 | {
54 | try { texture.root.uploadAtfData(data); }
55 | catch (e:Error) { helper.log("Texture restoration failed: " + e.message); }
56 |
57 | helper.onEndRestore();
58 | });
59 | }, onReloadError);
60 | };
61 | }
62 |
63 | reference.data = null; // prevent closures from keeping reference
64 | }
65 |
66 | function onReloadError(error:String):void
67 | {
68 | helper.log("Texture restoration failed for " + reference.url + ". " + error);
69 | helper.onEndRestore();
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/starling/src/starling/assets/ByteArrayFactory.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | /** This AssetFactory forwards ByteArrays to the AssetManager. It's the fallback when
6 | * no other factory can handle an asset reference (default priority: -100). */
7 | public class ByteArrayFactory extends AssetFactory
8 | {
9 | /** Creates a new instance. */
10 | public function ByteArrayFactory()
11 | {
12 | // not used, actually - this factory is used as a fallback with low priority
13 | addExtensions("bin");
14 | addMimeTypes("application/octet-stream");
15 | }
16 |
17 | /** @inheritDoc */
18 | override public function canHandle(reference:AssetReference):Boolean
19 | {
20 | return reference.data is ByteArray;
21 | }
22 |
23 | /** @inheritDoc */
24 | override public function create(reference:AssetReference, helper:AssetFactoryHelper,
25 | onComplete:Function, onError:Function):void
26 | {
27 | onComplete(reference.name, reference.data as ByteArray);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/starling/src/starling/assets/JsonFactory.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | import starling.utils.ByteArrayUtil;
6 |
7 | /** This AssetFactory creates objects from JSON data. */
8 | public class JsonFactory extends AssetFactory
9 | {
10 | /** Creates a new instance. */
11 | public function JsonFactory()
12 | {
13 | addExtensions("json");
14 | addMimeTypes("application/json", "text/json");
15 | }
16 |
17 | /** @inheritDoc */
18 | override public function canHandle(reference:AssetReference):Boolean
19 | {
20 | return super.canHandle(reference) || (reference.data is ByteArray &&
21 | (ByteArrayUtil.startsWithString(reference.data as ByteArray, "{")
22 | || ByteArrayUtil.startsWithString(reference.data as ByteArray, "[")));
23 | }
24 |
25 | /** @inheritDoc */
26 | override public function create(reference:AssetReference, helper:AssetFactoryHelper,
27 | onComplete:Function, onError:Function):void
28 | {
29 | try
30 | {
31 | var bytes:ByteArray = reference.data as ByteArray;
32 | var object:Object = JSON.parse(bytes.readUTFBytes(bytes.length));
33 | onComplete(reference.name, object);
34 | }
35 | catch (e:Error)
36 | {
37 | onError("Could not parse JSON: " + e.message);
38 | }
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/starling/src/starling/assets/SoundFactory.as:
--------------------------------------------------------------------------------
1 | package starling.assets
2 | {
3 | import flash.media.Sound;
4 | import flash.utils.ByteArray;
5 |
6 | import starling.utils.ByteArrayUtil;
7 |
8 | /** This AssetFactory creates sound assets. */
9 | public class SoundFactory extends AssetFactory
10 | {
11 | private static const MAGIC_NUMBERS_A:Array = [0xFF, 0xFB];
12 | private static const MAGIC_NUMBERS_B:Array = [0x49, 0x44, 0x33];
13 |
14 | /** Creates a new instance. */
15 | public function SoundFactory()
16 | {
17 | addMimeTypes("audio/mp3", "audio/mpeg3", "audio/mpeg");
18 | addExtensions("mp3");
19 | }
20 |
21 | /** @inheritDoc */
22 | override public function canHandle(reference:AssetReference):Boolean
23 | {
24 | if (reference.data is Sound || super.canHandle(reference))
25 | return true;
26 | else if (reference.data is ByteArray)
27 | {
28 | var byteData:ByteArray = reference.data as ByteArray;
29 | return ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_A) ||
30 | ByteArrayUtil.startsWithBytes(byteData, MAGIC_NUMBERS_B);
31 | }
32 | else return false;
33 | }
34 |
35 | /** @inheritDoc */
36 | override public function create(reference:AssetReference, helper:AssetFactoryHelper,
37 | onComplete:Function, onError:Function):void
38 | {
39 | var sound:Sound = reference.data as Sound;
40 | var bytes:ByteArray = reference.data as ByteArray;
41 |
42 | if (bytes)
43 | {
44 | try
45 | {
46 | sound = new Sound();
47 | sound.loadCompressedDataFromByteArray(bytes, bytes.length);
48 | }
49 | catch (e:Error)
50 | {
51 | onError("Could not load sound data: " + e.message);
52 | return;
53 | }
54 |
55 | }
56 |
57 | onComplete(reference.name, sound);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/starling/src/starling/core/starling_internal.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.core
12 | {
13 | /**
14 | * This namespace is used for undocumented APIs -- usually implementation
15 | * details -- which can't be private because they need to visible
16 | * to other classes.
17 | *
18 | * APIs in this namespace are completely unsupported and are likely to
19 | * change in future versions of Starling.
20 | */
21 | public namespace starling_internal;
22 | }
--------------------------------------------------------------------------------
/starling/src/starling/display/ButtonState.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.display
12 | {
13 | import starling.errors.AbstractClassError;
14 |
15 | /** A class that provides constant values for the states of the Button class. */
16 | public class ButtonState
17 | {
18 | /** @private */
19 | public function ButtonState() { throw new AbstractClassError(); }
20 |
21 | /** The button's default state. */
22 | public static const UP:String = "up";
23 |
24 | /** The button is pressed. */
25 | public static const DOWN:String = "down";
26 |
27 | /** The mouse hovers over the button. */
28 | public static const OVER:String = "over";
29 |
30 | /** The button was disabled altogether. */
31 | public static const DISABLED:String = "disabled";
32 |
33 | /** Indicates whether the given state string is valid. */
34 | public static function isValid(state:String):Boolean
35 | {
36 | return state == UP || state == DOWN || state == OVER || state == DISABLED;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/starling/src/starling/display/Sprite.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.display
12 | {
13 | /** A Sprite is the most lightweight, non-abstract container class.
14 | * Use it as a simple means of grouping objects together in one coordinate system.
15 | *
16 | * @see DisplayObject
17 | * @see DisplayObjectContainer
18 | */
19 | public class Sprite extends DisplayObjectContainer
20 | {
21 | /** Creates an empty sprite. */
22 | public function Sprite()
23 | {
24 | super();
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/starling/src/starling/errors/AbstractClassError.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.errors
12 | {
13 | /** An AbstractClassError is thrown when you attempt to create an instance of an abstract
14 | * class. */
15 | public class AbstractClassError extends Error
16 | {
17 | /** Creates a new AbstractClassError object. */
18 | public function AbstractClassError(message:*="Cannot instantiate abstract class", id:*=0)
19 | {
20 | super(message, id);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/starling/src/starling/errors/AbstractMethodError.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.errors
12 | {
13 | /** An AbstractMethodError is thrown when you attempt to call an abstract method. */
14 | public class AbstractMethodError extends Error
15 | {
16 | /** Creates a new AbstractMethodError object. */
17 | public function AbstractMethodError(message:*="Method needs to be implemented in subclass", id:*=0)
18 | {
19 | super(message, id);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/starling/src/starling/errors/MissingContextError.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.errors
12 | {
13 | /** A MissingContextError is thrown when a Context3D object is required but not (yet)
14 | * available. */
15 | public class MissingContextError extends Error
16 | {
17 | /** Creates a new MissingContextError object. */
18 | public function MissingContextError(message:*="Starling context is missing", id:*=0)
19 | {
20 | super(message, id);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/starling/src/starling/errors/NotSupportedError.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.errors
12 | {
13 | /** A NotSupportedError is thrown when you attempt to use a feature that is not supported
14 | * on the current platform. */
15 | public class NotSupportedError extends Error
16 | {
17 | /** Creates a new NotSupportedError object. */
18 | public function NotSupportedError(message:* = "", id:* = 0)
19 | {
20 | super(message, id);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/starling/src/starling/events/EnterFrameEvent.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.events
12 | {
13 | /** An EnterFrameEvent is triggered once per frame and is dispatched to all objects in the
14 | * display tree.
15 | *
16 | * It contains information about the time that has passed since the last frame. That way, you
17 | * can easily make animations that are independent of the frame rate, taking the passed time
18 | * into account.
19 | */
20 | public class EnterFrameEvent extends Event
21 | {
22 | /** Event type for a display object that is entering a new frame. */
23 | public static const ENTER_FRAME:String = "enterFrame";
24 |
25 | /** Creates an enter frame event with the passed time. */
26 | public function EnterFrameEvent(type:String, passedTime:Number, bubbles:Boolean=false)
27 | {
28 | super(type, bubbles, passedTime);
29 | }
30 |
31 | /** The time that has passed since the last frame (in seconds). */
32 | public function get passedTime():Number { return data as Number; }
33 | }
34 | }
--------------------------------------------------------------------------------
/starling/src/starling/events/ResizeEvent.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.events
12 | {
13 | import flash.geom.Point;
14 |
15 | /** A ResizeEvent is dispatched by the stage when the size of the Flash container changes.
16 | * Use it to update the Starling viewport and the stage size.
17 | *
18 | *
The event contains properties containing the updated width and height of the Flash
19 | * player. If you want to scale the contents of your stage to fill the screen, update the
20 | * Starling.current.viewPort rectangle accordingly. If you want to make use of
21 | * the additional screen estate, update the values of stage.stageWidth and
22 | * stage.stageHeight as well.
23 | *
24 | * @see starling.display.Stage
25 | * @see starling.core.Starling
26 | */
27 | public class ResizeEvent extends Event
28 | {
29 | /** Event type for a resized Flash player. */
30 | public static const RESIZE:String = "resize";
31 |
32 | /** Creates a new ResizeEvent. */
33 | public function ResizeEvent(type:String, width:int, height:int, bubbles:Boolean=false)
34 | {
35 | super(type, bubbles, new Point(width, height));
36 | }
37 |
38 | /** The updated width of the player. */
39 | public function get width():int { return (data as Point).x; }
40 |
41 | /** The updated height of the player. */
42 | public function get height():int { return (data as Point).y; }
43 | }
44 | }
--------------------------------------------------------------------------------
/starling/src/starling/events/TouchData.as:
--------------------------------------------------------------------------------
1 | package starling.events
2 | {
3 | /** Stores the information about raw touches in a pool of object instances.
4 | *
5 | *
This class is purely for internal use of the TouchProcessor.
6 | */
7 | public class TouchData
8 | {
9 | private var _id:int;
10 | private var _phase:String;
11 | private var _globalX:Number;
12 | private var _globalY:Number;
13 | private var _pressure:Number;
14 | private var _width:Number;
15 | private var _height:Number;
16 |
17 | private static var sPool:Vector. = new [];
18 |
19 | /** @private */
20 | public function TouchData()
21 | { }
22 |
23 | private function setTo(touchID:int, phase:String, globalX:Number, globalY:Number,
24 | pressure:Number=1.0, width:Number=1.0, height:Number=1.0):void
25 | {
26 | _id = touchID; _phase = phase; _globalX = globalX; _globalY = globalY;
27 | _pressure = pressure; _width = width; _height = height;
28 | }
29 |
30 | /** Creates a new TouchData instance with the given properties or returns one from
31 | * the object pool. */
32 | public static function fromPool(touchID:int, phase:String, globalX:Number, globalY:Number,
33 | pressure:Number=1.0, width:Number=1.0, height:Number=1.0):TouchData
34 | {
35 | var touchData:TouchData = sPool.length > 0 ? sPool.pop() : new TouchData();
36 | touchData.setTo(touchID, phase, globalX, globalY, pressure, width, height);
37 | return touchData;
38 | }
39 |
40 | /** Moves an instance back into the pool. */
41 | public static function toPool(rawTouch:TouchData):void
42 | {
43 | sPool[sPool.length] = rawTouch;
44 | }
45 |
46 | /** The identifier of a touch. '0' for mouse events, an increasing number for touches. */
47 | public function get id():int { return _id; }
48 |
49 | /** The current phase the touch is in. @see TouchPhase */
50 | public function get phase():String { return _phase; }
51 |
52 | /** The x-position of the touch in stage coordinates. */
53 | public function get globalX():Number { return _globalX; }
54 |
55 | /** The y-position of the touch in stage coordinates. */
56 | public function get globalY():Number { return _globalY; }
57 |
58 | /** A value between 0.0 and 1.0 indicating force of the contact with the device.
59 | * If the device does not support detecting the pressure, the value is 1.0. */
60 | public function get pressure():Number { return _pressure; }
61 |
62 | /** Width of the contact area.
63 | * If the device does not support detecting the pressure, the value is 1.0. */
64 | public function get width():Number { return _width; }
65 |
66 | /** Height of the contact area.
67 | * If the device does not support detecting the pressure, the value is 1.0. */
68 | public function get height():Number { return _height; }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/starling/src/starling/events/TouchPhase.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.events
12 | {
13 | import starling.errors.AbstractClassError;
14 |
15 | /** A class that provides constant values for the phases of a touch object.
16 | *
17 | *
A touch moves through at least the following phases in its life:
18 | *
19 | * BEGAN -> MOVED -> ENDED
20 | *
21 | *
Furthermore, a touch can enter a STATIONARY phase. That phase does not
22 | * trigger a touch event itself, and it can only occur in multitouch environments. Picture a
23 | * situation where one finger is moving and the other is stationary. A touch event will
24 | * be dispatched only to the object under the moving finger. In the list of touches
25 | * of that event, you will find the second touch in the stationary phase.
26 | *
27 | *
Finally, there's the HOVER phase, which is exclusive to mouse input. It is
28 | * the equivalent of a MouseOver event in Flash when the mouse button is
29 | * not pressed.
30 | */
31 | public final class TouchPhase
32 | {
33 | /** @private */
34 | public function TouchPhase() { throw new AbstractClassError(); }
35 |
36 | /** Only available for mouse input: the cursor hovers over an object without a
37 | * pressed button. */
38 | public static const HOVER:String = "hover";
39 |
40 | /** The finger touched the screen just now, or the mouse button was pressed. */
41 | public static const BEGAN:String = "began";
42 |
43 | /** The finger moves around on the screen, or the mouse is moved while the button is
44 | * pressed. */
45 | public static const MOVED:String = "moved";
46 |
47 | /** The finger or mouse (with pressed button) has not moved since the last frame. */
48 | public static const STATIONARY:String = "stationary";
49 |
50 | /** The finger was lifted from the screen or from the mouse button. */
51 | public static const ENDED:String = "ended";
52 | }
53 | }
--------------------------------------------------------------------------------
/starling/src/starling/filters/CompositeMode.as:
--------------------------------------------------------------------------------
1 | package starling.filters
2 | {
3 | import starling.errors.AbstractClassError;
4 |
5 | /** An enumeration class with the available modes that are offered by the CompositeFilter
6 | * to draw layers on top of each other.
7 | *
8 | * @see starling.filters.CompositeFilter
9 | */
10 | public class CompositeMode
11 | {
12 | private static const allModes:Array = [
13 | NORMAL, INSIDE, INSIDE_KNOCKOUT, OUTSIDE, OUTSIDE_KNOCKOUT
14 | ];
15 |
16 | /** @private */
17 | public function CompositeMode() { throw new AbstractClassError(); }
18 |
19 | /** Draw layer on top of destination. Corresponds to BlendMode.NORMAL.
20 | * src + dst × (1 - src.alpha) */
21 | public static const NORMAL:String = "normal";
22 |
23 | /** Draw layer on top of the destination using the destination's alpha value.
24 | * src × dst.alpha + dst × (1 - src.alpha) */
25 | public static const INSIDE:String = "inside";
26 |
27 | /** Draw layer on top of the destination, using the destination's inverted alpha value.
28 | * src × (1 - dst.alpha) + dst */
29 | public static const OUTSIDE:String = "outside";
30 |
31 | /** Draw only the new layer (erasing the old), using the destination's alpha value.
32 | * src × dst.alpha */
33 | public static const INSIDE_KNOCKOUT:String = "insideKnockout";
34 |
35 | /** Draw only the new layer (erasing the old), using the destination's inverted alpha value.
36 | * src × (1 - dst.alpha) */
37 | public static const OUTSIDE_KNOCKOUT:String = "outsideKnockout";
38 |
39 | /** Returns a different integer for each mode. */
40 | public static function getIndex(mode:String):int
41 | {
42 | return allModes.indexOf(mode);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/starling/src/starling/filters/IFilterHelper.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.filters
12 | {
13 | import flash.geom.Rectangle;
14 |
15 | import starling.display.DisplayObject;
16 | import starling.textures.Texture;
17 |
18 | /** An interface describing the methods available on the helper object passed
19 | * to the process call of fragment filters. It provides information about the
20 | * target object and methods to acquire and release pass textures.
21 | *
22 | * @see FragmentFilter#process()
23 | */
24 | public interface IFilterHelper
25 | {
26 | /** Gets a pass texture from the pool, or creates a new one (cleared and ready to be used
27 | * as render target). Its size is dictated by the bounds of the target display object
28 | * plus padding.
29 | *
30 | *
Beware: each call of this method counts as one render pass. For performance reasons,
31 | * the filter may be configured to render the last pass directly to the back buffer. In
32 | * that case, this method will return null for the last pass! That's the
33 | * sign for the process method to draw to the back buffer. If you receive
34 | * null too soon, the filter class probably didn't correctly override
35 | * numPasses.
36 | */
37 | function getTexture(resolution:Number=1.0):Texture;
38 |
39 | /** Puts a texture back into the pool to be reused later (or to be disposed
40 | * with the pool). */
41 | function putTexture(texture:Texture):void;
42 |
43 | /** The bounds of the target object (plus padding) in stage coordinates. */
44 | function get targetBounds():Rectangle;
45 |
46 | /** The display object the filter is currently attached to. */
47 | function get target():DisplayObject;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/starling/src/starling/rendering/BatchToken.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.rendering
12 | {
13 | import starling.utils.StringUtil;
14 |
15 | /** Points to a location within a list of MeshBatches.
16 | *
17 | *
Starling uses these tokens in its render cache. Each call to
18 | * painter.pushState() or painter.popState() provides a token
19 | * referencing the current location within the cache. In the next frame, if the relevant
20 | * part of the display tree has not changed, these tokens can be used to render directly
21 | * from the cache instead of constructing new MeshBatches.
22 | *
23 | * @see Painter
24 | */
25 | public class BatchToken
26 | {
27 | /** The ID of the current MeshBatch. */
28 | public var batchID:int;
29 |
30 | /** The ID of the next vertex within the current MeshBatch. */
31 | public var vertexID:int;
32 |
33 | /** The ID of the next index within the current MeshBatch. */
34 | public var indexID:int;
35 |
36 | /** Creates a new BatchToken. */
37 | public function BatchToken(batchID:int=0, vertexID:int=0, indexID:int=0)
38 | {
39 | setTo(batchID, vertexID, indexID);
40 | }
41 |
42 | /** Copies the properties from the given token to this instance. */
43 | public function copyFrom(token:BatchToken):void
44 | {
45 | batchID = token.batchID;
46 | vertexID = token.vertexID;
47 | indexID = token.indexID;
48 | }
49 |
50 | /** Changes all properties at once. */
51 | public function setTo(batchID:int=0, vertexID:int=0, indexID:int=0):void
52 | {
53 | this.batchID = batchID;
54 | this.vertexID = vertexID;
55 | this.indexID = indexID;
56 | }
57 |
58 | /** Resets all properties to zero. */
59 | public function reset():void
60 | {
61 | batchID = vertexID = indexID = 0;
62 | }
63 |
64 | /** Indicates if this token contains the same values as the given one. */
65 | public function equals(other:BatchToken):Boolean
66 | {
67 | return batchID == other.batchID && vertexID == other.vertexID && indexID == other.indexID;
68 | }
69 |
70 | /** Creates a String representation of this instance. */
71 | public function toString():String
72 | {
73 | return StringUtil.format("[BatchToken batchID={0} vertexID={1} indexID={2}]",
74 | batchID, vertexID, indexID);
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/starling/src/starling/rendering/VertexDataAttribute.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.rendering
12 | {
13 | /** Holds the properties of a single attribute in a VertexDataFormat instance.
14 | * The member variables must never be changed; they are only public
15 | * for performance reasons. */
16 | internal class VertexDataAttribute
17 | {
18 | private static const FORMAT_SIZES:Object = {
19 | "bytes4": 4,
20 | "float1": 4,
21 | "float2": 8,
22 | "float3": 12,
23 | "float4": 16
24 | };
25 |
26 | public var name:String;
27 | public var format:String;
28 | public var isColor:Boolean;
29 | public var offset:int; // in bytes
30 | public var size:int; // in bytes
31 |
32 | /** Creates a new instance with the given properties. */
33 | public function VertexDataAttribute(name:String, format:String, offset:int)
34 | {
35 | if (!(format in FORMAT_SIZES))
36 | throw new ArgumentError(
37 | "Invalid attribute format: " + format + ". " +
38 | "Use one of the following: 'float1'-'float4', 'bytes4'");
39 |
40 | this.name = name;
41 | this.format = format;
42 | this.offset = offset;
43 | this.size = FORMAT_SIZES[format];
44 | this.isColor = name.indexOf("color") != -1 || name.indexOf("Color") != -1
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/starling/src/starling/text/BitmapFontType.as:
--------------------------------------------------------------------------------
1 | package starling.text
2 | {
3 | import starling.errors.AbstractClassError;
4 |
5 | /** This class is an enumeration of possible types of bitmap fonts. */
6 | public class BitmapFontType
7 | {
8 | /** @private */
9 | public function BitmapFontType() { throw new AbstractClassError(); }
10 |
11 | /** A standard bitmap font uses a regular RGBA texture containing all glyphs. */
12 | public static const STANDARD:String = "standard";
13 |
14 | /** Indicates that the font texture contains a single channel distance field texture
15 | * to be rendered with the DistanceFieldStyle. */
16 | public static const DISTANCE_FIELD:String = "distanceField";
17 |
18 | /** Indicates that the font texture contains a multi channel distance field texture
19 | * to be rendered with the DistanceFieldStyle. */
20 | public static const MULTI_CHANNEL_DISTANCE_FIELD:String = "multiChannelDistanceField";
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/starling/src/starling/text/ITextCompositor.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.text
12 | {
13 | import starling.display.MeshBatch;
14 | import starling.styles.MeshStyle;
15 |
16 | /** A text compositor arranges letters for Starling's TextField. */
17 | public interface ITextCompositor
18 | {
19 | /** Draws the given text into a MeshBatch, using the supplied format and options. */
20 | function fillMeshBatch(meshBatch:MeshBatch, width:Number, height:Number, text:String,
21 | format:TextFormat, options:TextOptions=null):void;
22 |
23 | /** Clears the MeshBatch (filled by the same class) and disposes any resources that
24 | * are no longer needed. */
25 | function clearMeshBatch(meshBatch:MeshBatch):void;
26 |
27 | /** Creates and/or sets up the default MeshStyle to be used for rendering.
28 | * If previousStyle has the correct type, it is configured as needed and
29 | * then returned; otherwise, a new style is created, configured and returned.
30 | * The method may return null if there are no special style requirements. */
31 | function getDefaultMeshStyle(previousStyle:MeshStyle,
32 | format:TextFormat, options:TextOptions):MeshStyle;
33 |
34 | /** Frees all resources allocated by the compositor. */
35 | function dispose():void;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/starling/src/starling/text/TextFieldAutoSize.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.text
12 | {
13 | import starling.errors.AbstractClassError;
14 |
15 | /** This class is an enumeration of constant values used in setting the
16 | * autoSize property of the TextField class. */
17 | public class TextFieldAutoSize
18 | {
19 | /** @private */
20 | public function TextFieldAutoSize() { throw new AbstractClassError(); }
21 |
22 | /** No auto-sizing will happen. */
23 | public static const NONE:String = "none";
24 |
25 | /** The text field will grow/shrink sidewards; no line-breaks will be added.
26 | * The height of the text field remains unchanged. Not supported for HTML text! */
27 | public static const HORIZONTAL:String = "horizontal";
28 |
29 | /** The text field will grow/shrink downwards, adding line-breaks when necessary.
30 | * The width of the text field remains unchanged. */
31 | public static const VERTICAL:String = "vertical";
32 |
33 | /** The text field will grow to the right and bottom; no line-breaks will be added. */
34 | public static const BOTH_DIRECTIONS:String = "bothDirections";
35 | }
36 | }
--------------------------------------------------------------------------------
/starling/src/starling/textures/TextureSmoothing.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.textures
12 | {
13 | import starling.errors.AbstractClassError;
14 |
15 | /** A class that provides constant values for the possible smoothing algorithms of a texture. */
16 | public class TextureSmoothing
17 | {
18 | /** @private */
19 | public function TextureSmoothing() { throw new AbstractClassError(); }
20 |
21 | /** No smoothing, also called "Nearest Neighbor". Pixels will scale up as big rectangles. */
22 | public static const NONE:String = "none";
23 |
24 | /** Bilinear filtering. Creates smooth transitions between pixels. */
25 | public static const BILINEAR:String = "bilinear";
26 |
27 | /** Trilinear filtering. Highest quality by taking the next mip map level into account. */
28 | public static const TRILINEAR:String = "trilinear";
29 |
30 | /** Determines whether a smoothing value is valid. */
31 | public static function isValid(smoothing:String):Boolean
32 | {
33 | return smoothing == NONE || smoothing == BILINEAR || smoothing == TRILINEAR;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/starling/src/starling/utils/Align.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.utils
12 | {
13 | import starling.errors.AbstractClassError;
14 |
15 | /** A class that provides constant values for horizontal and vertical alignment of objects. */
16 | public final class Align
17 | {
18 | /** @private */
19 | public function Align() { throw new AbstractClassError(); }
20 |
21 | /** Horizontal left alignment. */
22 | public static const LEFT:String = "left";
23 |
24 | /** Horizontal right alignment. */
25 | public static const RIGHT:String = "right";
26 |
27 | /** Vertical top alignment. */
28 | public static const TOP:String = "top";
29 |
30 | /** Vertical bottom alignment. */
31 | public static const BOTTOM:String = "bottom";
32 |
33 | /** Centered alignment. */
34 | public static const CENTER:String = "center";
35 |
36 | /** Indicates whether the given alignment string is valid. */
37 | public static function isValid(align:String):Boolean
38 | {
39 | return align == LEFT || align == RIGHT || align == CENTER ||
40 | align == TOP || align == BOTTOM;
41 | }
42 |
43 | /** Indicates if the given string is a valid horizontal alignment. */
44 | public static function isValidHorizontal(align:String):Boolean
45 | {
46 | return align == LEFT || align == CENTER || align == RIGHT;
47 | }
48 |
49 | /** Indicates if the given string is a valid vertical alignment. */
50 | public static function isValidVertical(align:String):Boolean
51 | {
52 | return align == TOP || align == CENTER || align == BOTTOM;
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/starling/src/starling/utils/MeshSubset.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.utils
12 | {
13 | /** A class describing a range of vertices and indices, thus referencing a subset of a Mesh. */
14 | public class MeshSubset
15 | {
16 | /** The ID of the first vertex. */
17 | public var vertexID:int;
18 |
19 | /** The total number of vertices. */
20 | public var numVertices:int;
21 |
22 | /** The ID of the first index. */
23 | public var indexID:int;
24 |
25 | /** The total number of indices. */
26 | public var numIndices:int;
27 |
28 | /** Creates a new MeshSubset. */
29 | public function MeshSubset(vertexID:int=0, numVertices:int=-1,
30 | indexID:int=0, numIndices:int=-1)
31 | {
32 | setTo(vertexID, numVertices, indexID, numIndices);
33 | }
34 |
35 | /** Changes all properties at once.
36 | * Call without any arguments to reference a complete mesh. */
37 | public function setTo(vertexID:int=0, numVertices:int=-1,
38 | indexID:int=0, numIndices:int=-1):void
39 | {
40 | this.vertexID = vertexID;
41 | this.numVertices = numVertices;
42 | this.indexID = indexID;
43 | this.numIndices = numIndices;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/starling/src/starling/utils/ScaleMode.as:
--------------------------------------------------------------------------------
1 | package starling.utils
2 | {
3 | import starling.errors.AbstractClassError;
4 |
5 | /** A class that provides constant values for the 'RectangleUtil.fit' method. */
6 | public class ScaleMode
7 | {
8 | /** @private */
9 | public function ScaleMode() { throw new AbstractClassError(); }
10 |
11 | /** Specifies that the rectangle is not scaled, but simply centered within the
12 | * specified area. */
13 | public static const NONE:String = "none";
14 |
15 | /** Specifies that the rectangle fills the specified area without distortion
16 | * but possibly with some cropping, while maintaining the original aspect ratio. */
17 | public static const NO_BORDER:String = "noBorder";
18 |
19 | /** Specifies that the entire rectangle will be scaled to fit into the specified
20 | * area, while maintaining the original aspect ratio. This might leave empty bars at
21 | * either the top and bottom, or left and right. */
22 | public static const SHOW_ALL:String = "showAll";
23 |
24 | /** Indicates whether the given scale mode string is valid. */
25 | public static function isValid(scaleMode:String):Boolean
26 | {
27 | return scaleMode == NONE || scaleMode == NO_BORDER || scaleMode == SHOW_ALL;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/starling/src/starling/utils/deg2rad.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.utils
12 | {
13 | /** Converts an angle from degrees into radians. */
14 | public function deg2rad(deg:Number):Number
15 | {
16 | return deg / 180.0 * Math.PI;
17 | }
18 | }
--------------------------------------------------------------------------------
/starling/src/starling/utils/execute.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package starling.utils
12 | {
13 | /** Executes a function with the specified arguments. If the argument count does not match
14 | * the function, the argument list is cropped / filled up with null values. */
15 | public function execute(func:Function, ...args):void
16 | {
17 | if (func != null)
18 | {
19 | var i:int;
20 | var maxNumArgs:int = func.length;
21 |
22 | for (i=args.length; i
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 |
--------------------------------------------------------------------------------
/tests/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Run Tests",
9 | "type": "swf",
10 | "request": "launch",
11 | "profile": "desktop",
12 | "preLaunchTask": "ActionScript: compile debug - asconfig.json"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | # Unit Tests
2 |
3 | In the past, unit tests relied on old `FlexUnit` libraries, but those are no longer officially available.
4 | To get rid of this dependency, I created a couple of lightweight test classes that together make up `starling.unit`.
5 | Those classes are currently simply a part of the `src` directory – but if there's interest, we could put them into a separate library, too.
6 |
7 | In any case, this means that it's now really easy to run the tests.
8 | Simply compile this project just like any other AIR project, e.g. just as Desktop AIR app.
9 | The unit tests will start immediately when that app is launched.
10 |
11 | Edit the class `TestSuite` to focus on specific unit tests, e.g. by commenting out any tests you're not interested in.
12 |
--------------------------------------------------------------------------------
/tests/asconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "config": "air",
3 | "compilerOptions": {
4 | "output": "out/tests.swf",
5 | "source-path": [
6 | "src",
7 | "../starling/src"
8 | ]
9 | },
10 | "mainClass": "Startup",
11 | "application": "src/UnitTest-app.xml",
12 | "airOptions": {
13 | "files": [
14 | {
15 | "file": "fixtures",
16 | "path": "fixtures"
17 | }
18 | ]
19 | }
20 | }
--------------------------------------------------------------------------------
/tests/fixtures/atlas.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/tests/fixtures/audio.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/tests/fixtures/audio.mp3
--------------------------------------------------------------------------------
/tests/fixtures/data.txt:
--------------------------------------------------------------------------------
1 | data
--------------------------------------------------------------------------------
/tests/fixtures/font.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/fixtures/image.atf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/tests/fixtures/image.atf
--------------------------------------------------------------------------------
/tests/fixtures/image.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/tests/fixtures/image.gif
--------------------------------------------------------------------------------
/tests/fixtures/image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/tests/fixtures/image.jpg
--------------------------------------------------------------------------------
/tests/fixtures/image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/tests/fixtures/image.png
--------------------------------------------------------------------------------
/tests/fixtures/invalid.json:
--------------------------------------------------------------------------------
1 |
2 |
2 |
--------------------------------------------------------------------------------
/tests/src/Startup.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import flash.display.Sprite;
4 | import flash.display.StageAlign;
5 | import flash.display.StageScaleMode;
6 | import flash.events.UncaughtErrorEvent;
7 |
8 | import starling.core.Starling;
9 |
10 | [SWF(width="800", height="800", frameRate="60", backgroundColor="#000000")]
11 | public class Startup extends Sprite
12 | {
13 | private var _starling:Starling;
14 |
15 | public function Startup()
16 | {
17 | loaderInfo.uncaughtErrorEvents.addEventListener (
18 | UncaughtErrorEvent.UNCAUGHT_ERROR, function(event:UncaughtErrorEvent):void
19 | {
20 | trace(event.error, "Uncaught Error: " + event.error.message);
21 | }
22 | );
23 |
24 | stage.scaleMode = StageScaleMode.NO_SCALE;
25 | stage.align = StageAlign.TOP_LEFT;
26 |
27 | _starling = new Starling(TestSuite, stage);
28 | _starling.start();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/tests/src/UnitTest-app.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.gamua.starling.tests
4 | Starling-Tests
5 | Starling Tests
6 | 1.0.0
7 |
8 | SWF file name is set automatically at compile time
9 | true
10 | direct
11 | true
12 | high
13 |
14 |
--------------------------------------------------------------------------------
/tests/src/starling/unit/SimpleTestGui.as:
--------------------------------------------------------------------------------
1 | package starling.unit
2 | {
3 | import starling.display.Sprite;
4 | import starling.text.TextField;
5 | import starling.utils.Align;
6 | import starling.utils.Color;
7 | import starling.utils.StringUtil;
8 |
9 | public class SimpleTestGui extends TestGui
10 | {
11 | private static const LINE_HEIGHT:int = 10;
12 | private static const FONT_NAME:String = "mini";
13 | private static const FONT_SIZE:int = -1;
14 |
15 | private var _width:int;
16 | private var _height:int;
17 | private var _logLines:Sprite;
18 | private var _numLogLines:int;
19 | private var _statusInfo:TextField;
20 |
21 | public function SimpleTestGui(testRunner:TestRunner, width:int, height:int)
22 | {
23 | super(testRunner);
24 |
25 | _width = width;
26 | _height = height;
27 |
28 | _statusInfo = new TextField(width, LINE_HEIGHT, "");
29 | _statusInfo.format.setTo(FONT_NAME, FONT_SIZE, Color.WHITE);
30 | _statusInfo.format.horizontalAlign = Align.RIGHT;
31 | addChild(_statusInfo);
32 |
33 | _logLines = new Sprite();
34 | addChild(_logLines);
35 | }
36 |
37 | override public function log(message:String, color:uint=0xffffff):void
38 | {
39 | super.log(message, color);
40 |
41 | var logLine:TextField = new TextField(_width, LINE_HEIGHT, message);
42 | logLine.format.setTo(FONT_NAME, FONT_SIZE, color);
43 | logLine.format.horizontalAlign = Align.LEFT;
44 | logLine.y = _numLogLines * LINE_HEIGHT;
45 | _logLines.addChild(logLine);
46 | _numLogLines++;
47 |
48 | if (_numLogLines * LINE_HEIGHT > _height)
49 | {
50 | _logLines.removeChildAt(0);
51 | _logLines.y -= LINE_HEIGHT;
52 | }
53 | }
54 |
55 | override public function assert(success:Boolean, message:String=null):void
56 | {
57 | super.assert(success, message);
58 |
59 | _statusInfo.text = StringUtil.format("Passed {0} of {1} tests", successCount, testCount);
60 | _statusInfo.format.color = (successCount == testCount) ? Color.GREEN : Color.RED;
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/tests/src/starling/unit/TestGui.as:
--------------------------------------------------------------------------------
1 | package starling.unit
2 | {
3 | import flash.utils.getTimer;
4 |
5 | import starling.display.Sprite;
6 | import starling.events.Event;
7 | import starling.utils.Color;
8 | import flash.utils.getQualifiedClassName;
9 | import starling.errors.AbstractClassError;
10 |
11 | public class TestGui extends Sprite
12 | {
13 | private var _testRunner:TestRunner;
14 | private var _loop:Boolean;
15 | private var _testCount:int;
16 | private var _successCount:int;
17 | private var _startMoment:Number;
18 | private var _isPaused:Boolean;
19 |
20 | public function TestGui(testRunner:TestRunner)
21 | {
22 | _testRunner = testRunner;
23 | _testRunner.logFunction = log;
24 | _testRunner.assertFunction = assert;
25 |
26 | if (getQualifiedClassName(this) == "starling.unit::TestGui")
27 | throw new AbstractClassError();
28 | }
29 |
30 | public function start(loop:Boolean=false):void
31 | {
32 | _loop = loop;
33 | _startMoment = getTimer() / 1000;
34 | _isPaused = false;
35 | addEventListener(Event.ENTER_FRAME, onEnterFrame);
36 | }
37 |
38 | public function stop():void
39 | {
40 | removeEventListener(Event.ENTER_FRAME, onEnterFrame);
41 | _testRunner.resetRun();
42 | }
43 |
44 | private function onEnterFrame(event:Event):void
45 | {
46 | if (_isPaused) return;
47 |
48 | var status:String = _testRunner.runNext();
49 |
50 | if (status == TestRunner.STATUS_FINISHED)
51 | {
52 | var duration:int = getTimer() / 1000 - _startMoment;
53 | stop();
54 |
55 | log("Finished all tests!", Color.AQUA);
56 | log("Duration: " + duration + " seconds.", Color.AQUA);
57 |
58 | if (_loop) start(true);
59 | else onFinished();
60 | }
61 | }
62 |
63 | public function onFinished():void
64 | {
65 | // override in subclass
66 | }
67 |
68 | public function log(message:String, color:uint=0xffffff):void
69 | {
70 | trace(message);
71 | }
72 |
73 | public function assert(success:Boolean, message:String=null):void
74 | {
75 | _testCount++;
76 |
77 | if (success)
78 | {
79 | _successCount++;
80 | }
81 | else
82 | {
83 | message = message ? message : "Assertion failed.";
84 | log(" " + message, Color.RED);
85 | }
86 | }
87 |
88 | public function get testCount():int { return _testCount; }
89 | public function get successCount():int { return _successCount; }
90 | public function get isStarted():Boolean { return _startMoment >= 0; }
91 |
92 | public function get isPaused():Boolean { return _isPaused; }
93 | public function set isPaused(value:Boolean):void { _isPaused = value; }
94 | }
95 | }
--------------------------------------------------------------------------------
/tests/src/tests/display/BlendModeTest.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package tests.display
12 | {
13 | import flash.display3D.Context3DBlendFactor;
14 |
15 | import starling.display.BlendMode;
16 | import starling.unit.UnitTest;
17 |
18 | public class BlendModeTest extends UnitTest
19 | {
20 | public function testRegisterBlendMode():void
21 | {
22 | var name:String = "test";
23 | var srcFactor:String = Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA;
24 | var dstFactor:String = Context3DBlendFactor.DESTINATION_COLOR;
25 |
26 | BlendMode.register(name, srcFactor, dstFactor);
27 |
28 | assertEqual(srcFactor, BlendMode.get(name).sourceFactor);
29 | assertEqual(dstFactor, BlendMode.get(name).destinationFactor);
30 | }
31 |
32 | public function testGetAllBlendModes():void
33 | {
34 | var name:String = "test";
35 | var srcFactor:String = Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA;
36 | var dstFactor:String = Context3DBlendFactor.DESTINATION_COLOR;
37 |
38 | BlendMode.register(name, srcFactor, dstFactor);
39 |
40 | var modeFilter:Function = function(modeName:String):Function
41 | {
42 | return function(mode:BlendMode, ...args):Boolean {
43 | return mode.name == modeName;
44 | };
45 | };
46 |
47 | var modes:Array = BlendMode.getAll();
48 | assertEqual(modes.filter(modeFilter("test")).length, 1);
49 | assertEqual(modes.filter(modeFilter("normal")).length, 1);
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/tests/src/tests/display/ButtonTest.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package tests.display
12 | {
13 | import flash.geom.Rectangle;
14 |
15 | import starling.display.Button;
16 | import starling.textures.Texture;
17 | import starling.unit.UnitTest;
18 |
19 | import utils.MockTexture;
20 |
21 | public class ButtonTest extends UnitTest
22 | {
23 | private static const E:Number = 0.0001;
24 |
25 | public function testWidthAndHeight():void
26 | {
27 | var texture:Texture = new MockTexture(100, 50);
28 | var button:Button = new Button(texture, "test");
29 | var textBounds:Rectangle = new Rectangle();
30 |
31 | assertEquivalent(button.width, 100);
32 | assertEquivalent(button.height, 50);
33 | assertEquivalent(button.scaleX, 1.0);
34 | assertEquivalent(button.scaleY, 1.0);
35 |
36 | button.scale = 0.5;
37 | textBounds.copyFrom(button.textBounds);
38 |
39 | assertEquivalent(button.width, 50);
40 | assertEquivalent(button.height, 25);
41 | assertEquivalent(button.scaleX, 0.5);
42 | assertEquivalent(button.scaleY, 0.5);
43 | assertEquivalent(textBounds.width, 100);
44 | assertEquivalent(textBounds.height, 50);
45 |
46 | button.width = 100;
47 | button.height = 50;
48 | textBounds.copyFrom(button.textBounds);
49 |
50 | assertEquivalent(button.width, 100);
51 | assertEquivalent(button.height, 50);
52 | assertEquivalent(button.scaleX, 0.5);
53 | assertEquivalent(button.scaleY, 0.5);
54 | assertEquivalent(textBounds.width, 200);
55 | assertEquivalent(textBounds.height, 100);
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/tests/src/tests/display/Sprite3DTest.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package tests.display
12 | {
13 | import starling.display.Sprite;
14 | import starling.display.Sprite3D;
15 | import starling.unit.UnitTest;
16 |
17 | public class Sprite3DTest extends UnitTest
18 | {
19 | public function testBasicProperties():void
20 | {
21 | var sprite:Sprite3D = new Sprite3D();
22 | assertEqual(0, sprite.numChildren);
23 | assertEqual(0, sprite.rotationX);
24 | assertEqual(0, sprite.rotationY);
25 | assertEqual(0, sprite.pivotZ);
26 | assertEqual(0, sprite.z);
27 |
28 | sprite.addChild(new Sprite());
29 | sprite.rotationX = 2;
30 | sprite.rotationY = 3;
31 | sprite.pivotZ = 4;
32 | sprite.z = 5;
33 |
34 | assertEqual(1, sprite.numChildren);
35 | assertEqual(2, sprite.rotationX);
36 | assertEqual(3, sprite.rotationY);
37 | assertEqual(4, sprite.pivotZ);
38 | assertEqual(5, sprite.z);
39 | }
40 |
41 | public function testIs3D():void
42 | {
43 | var sprite3D:Sprite3D = new Sprite3D();
44 | assertTrue(sprite3D.is3D);
45 |
46 | var sprite:Sprite = new Sprite();
47 | assertFalse(sprite.is3D);
48 |
49 | var child:Sprite = new Sprite();
50 | sprite.addChild(child);
51 | assertFalse(child.is3D);
52 |
53 | sprite3D.addChild(sprite);
54 | assertTrue(sprite.is3D);
55 | assertTrue(child.is3D);
56 |
57 | sprite.removeFromParent();
58 | assertFalse(sprite.is3D);
59 | assertFalse(child.is3D);
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/tests/src/tests/filters/FragmentFilterTest.as:
--------------------------------------------------------------------------------
1 | // =================================================================================================
2 | //
3 | // Starling Framework
4 | // Copyright Gamua GmbH. All Rights Reserved.
5 | //
6 | // This program is free software. You can redistribute and/or modify it
7 | // in accordance with the terms of the accompanying license agreement.
8 | //
9 | // =================================================================================================
10 |
11 | package tests.filters
12 | {
13 | import starling.display.Sprite;
14 | import starling.events.EnterFrameEvent;
15 | import starling.events.Event;
16 | import starling.filters.FragmentFilter;
17 | import starling.unit.UnitTest;
18 |
19 | public class FragmentFilterTest extends UnitTest
20 | {
21 | public function testEnterFrameEvent():void
22 | {
23 | var eventCount:int = 0;
24 | var event:EnterFrameEvent = new EnterFrameEvent(Event.ENTER_FRAME, 0.1);
25 | var filter:FragmentFilter = new FragmentFilter();
26 | var sprite:Sprite = new Sprite();
27 | var sprite2:Sprite = new Sprite();
28 |
29 | filter.addEventListener(Event.ENTER_FRAME, onEvent);
30 | sprite.dispatchEvent(event);
31 | assertEqual(0, eventCount);
32 |
33 | sprite.filter = filter;
34 | sprite.dispatchEvent(event);
35 | assertEqual(1, eventCount);
36 |
37 | sprite.dispatchEvent(event);
38 | assertEqual(2, eventCount);
39 |
40 | sprite2.filter = filter;
41 | sprite.dispatchEvent(event);
42 | assertEqual(2, eventCount);
43 |
44 | sprite.filter = filter;
45 | sprite.dispatchEvent(event);
46 | assertEqual(3, eventCount);
47 |
48 | filter.removeEventListener(Event.ENTER_FRAME, onEvent);
49 | sprite.dispatchEvent(event);
50 | assertEqual(3, eventCount);
51 |
52 | function onEvent(event:EnterFrameEvent):void
53 | {
54 | ++eventCount;
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/tests/src/tests/utils/ByteArrayUtilTest.as:
--------------------------------------------------------------------------------
1 | package tests.utils
2 | {
3 | import flash.utils.ByteArray;
4 |
5 | import starling.unit.UnitTest;
6 | import starling.utils.ByteArrayUtil;
7 |
8 | public class ByteArrayUtilTest extends UnitTest
9 | {
10 | public function testStartsWith():void
11 | {
12 | var byteArray:ByteArray = new ByteArray();
13 | byteArray.writeUTFBytes(" \n");
14 |
15 | assertTrue(ByteArrayUtil.startsWithString(byteArray, "
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/util/idea/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Datasource local storage ignored files
5 | /dataSources/
6 | /dataSources.local.xml
7 | # Editor-based HTTP Client requests
8 | /httpRequests/
9 |
--------------------------------------------------------------------------------
/util/idea/.idea/idea.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/util/idea/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/util/idea/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/util/idea/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/util/idea/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/util/idea/README.md:
--------------------------------------------------------------------------------
1 | # Tools for IntelliJ IDEA
2 |
3 | ## copy_resources.rb
4 |
5 | IntelliJ IDEA allows you specify which resources to add to your application package. This is done in the module settings, within the build configuration. Enter one of the last tabs ("iOS", "Android", or "AIR Package") and look for the section "Files and folders to package".
6 |
7 | This works fine when you actually create the package or debug on a real device; however, when running the simulator, those resources won't show up. As a workaround, you can copy them manually into the output folder — or you let this little Ruby script do the work for you.
8 |
9 | It parses IDEA's module file to find out which resources to copy and where to put them. It's easy to integrate it into IDEA by adding it as an "External Tool" (IntelliJ IDEA Preferences - Tools).
10 |
11 | Create one such tool entry for each platform you support. Here are sample settings for iOS:
12 |
13 | * Name: Copy Resources - iOS
14 | * Description: Copies the project's resources into the output folder so that the simulator can find them.
15 | * Program: `/path/to/starling/util/idea/copy_resources.rb`
16 | * Parameters: `$ModuleFilePath$ ios`
17 | * Working Directory: [leave empty]
18 |
19 | [Other options for the second parameter are "android" and "air-desktop". Alternatively, you can also omit the second parameter; in that case, the resources of all configured platforms will be copied.]
20 |
21 | To try out the tool, first click on the project you want to process, then on "Tools - External Tools - Copy Resources [platform]". If everything works, you will see the terminal output of the tools displayed inside IDEA.
22 |
23 | To make sure that the files are always copied before you run/debug your app in the simulator, add the tool to the "Before launch" section of the respective run/debug configuration.
24 |
25 | Final note: that we have to do this at all should be considered a bug in IDEA. To make sure that is fixed in the future, please take the time to vote for the bug here: [IDEA-94578](https://youtrack.jetbrains.com/issue/IDEA-94578)
26 |
--------------------------------------------------------------------------------
/util/idea/copy_resources.rb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/ruby
2 |
3 | require "rexml/document"
4 | require "fileutils"
5 | include REXML
6 |
7 | ALL_PLATFORMS = "all-platforms"
8 | platforms = ["ios", "android", "air-desktop"]
9 | script_name = File.basename(__FILE__)
10 |
11 | if ARGV.count < 1
12 | puts "Usage: #{script_name} module.iml [platform]"
13 | puts " - platform being one of: #{platforms.join(', ')}"
14 | puts " - omit 'platform' to copy all resources"
15 | exit
16 | end
17 |
18 | module_file = ARGV[0]
19 | platform = ARGV.count > 1 ? ARGV[1].downcase : ALL_PLATFORMS
20 |
21 | unless (platform == ALL_PLATFORMS or platforms.include? platform)
22 | puts "Invalid platform: #{platform}"
23 | exit
24 | end
25 |
26 | unless File.exist?(module_file)
27 | puts "Module file not found: #{module_file}"
28 | exit
29 | end
30 |
31 | puts "Copying resources for #{File.basename(module_file)} (#{platform}) ..."
32 |
33 | copy_count = 0
34 | module_dir = File.dirname(module_file)
35 | module_doc = Document.new(File.open(module_file))
36 |
37 | XPath.each module_doc, "//configuration" do |configuration|
38 | output_folder = configuration.attributes["output-folder"]
39 | output_folder.gsub!("$MODULE_DIR$", module_dir)
40 | output_folder.gsub!("$USER_HOME$", Dir.home)
41 | configuration_name = configuration.attributes["name"]
42 |
43 | packaging_platform =
44 | if platform == ALL_PLATFORMS then "*[starts-with(name(), 'packaging-')]"
45 | else "packaging-#{platform}"
46 | end
47 |
48 | XPath.each configuration, packaging_platform do |platform|
49 | if platform.has_elements?
50 | actual_platform = platform.name.gsub("packaging-", "")
51 | puts "-> #{configuration_name} -> #{actual_platform}"
52 | XPath.each platform, "files-to-package/FilePathAndPathInPackage/" do |entry|
53 | file_path = entry.attributes["file-path"].gsub("$MODULE_DIR$", module_dir)
54 | path_in_package = entry.attributes["path-in-package"]
55 | FileUtils.mkdir_p File.join(output_folder, path_in_package)
56 | FileUtils.cp_r File.join(file_path, "."), File.join(output_folder, path_in_package)
57 | copy_count += 1
58 | end
59 | end
60 | end
61 | end
62 |
63 | puts "Copied #{copy_count} resource-folder(s)."
64 |
--------------------------------------------------------------------------------
/util/ios_asset_project/README.md:
--------------------------------------------------------------------------------
1 | # Icons, Launch Storyboards and the Assets Catalog
2 |
3 | Our friends from _distriqt_ have written [extensive documentation][1] on how to add an icon (in numerous variants), as well as a launch screen, for deployment to iOS.
4 | This folder contains an Xcode project that you can use to customize and export the required files.
5 |
6 | * After making the modifications (as described in the above link), build the project with Xcode.
7 | * Then, right-click on "iOS Asset Project.app" (in the project navigator on the left) and select 'Show in Finder'.
8 | * In the Finder, click on the app file again and choose 'Show Package Contents'.
9 | * Copy the files `Assets.car` and `LaunchScreen.storyboardc` (optional) to the Starling Scaffold (`system` subfolder) or your own AIR project.
10 |
11 | [1]: https://docs.airnativeextensions.com/docs/tutorials/ios-icons-assets-car
12 |
13 | ### Launch Screen storyboard vs. Harman 'Free Tier'
14 |
15 | On the "Free Tier" of AIR, you're required to show a splash screen with the AIR logo.
16 | The AIR SDK handles this via its own "launch screen" storyboard.
17 | It will replace any custom one you've made (like the one in this Xcode project).
18 |
19 | However, if you supply an `Assets.car` file (and you will, because it contains the app icon), you need to provide the splash image assets, as well.
20 | They're found in the AIR SDK (`lib/aot/res` folder), but I've also included them in the Xcode project.
21 |
22 | So, in the free tier:
23 |
24 | * Make sure the `Assets.car` file contains the AIR splash images.
25 | * Don't bother to customize and export the launch screen storyboard, as will be ignored by AIR.
26 |
27 | If you're in a commercial tier:
28 |
29 | * You can remove `splash_landscape` and `splash_portrait` from `Assets.xcassets` (by deleting them from the Xcode project).
30 | * Customize the launch screen storyboard, e.g. with your own logo and colors.
31 | * Include `LaunchScreen.storyboardc` when you copy over your assets from the compiled app.
32 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "Icon-App-20x20@2x.png",
5 | "idiom" : "iphone",
6 | "scale" : "2x",
7 | "size" : "20x20"
8 | },
9 | {
10 | "filename" : "Icon-App-20x20@3x.png",
11 | "idiom" : "iphone",
12 | "scale" : "3x",
13 | "size" : "20x20"
14 | },
15 | {
16 | "filename" : "Icon-App-29x29@2x.png",
17 | "idiom" : "iphone",
18 | "scale" : "2x",
19 | "size" : "29x29"
20 | },
21 | {
22 | "filename" : "Icon-App-29x29@3x.png",
23 | "idiom" : "iphone",
24 | "scale" : "3x",
25 | "size" : "29x29"
26 | },
27 | {
28 | "filename" : "Icon-App-40x40@2x.png",
29 | "idiom" : "iphone",
30 | "scale" : "2x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "filename" : "Icon-App-40x40@3x.png",
35 | "idiom" : "iphone",
36 | "scale" : "3x",
37 | "size" : "40x40"
38 | },
39 | {
40 | "filename" : "Icon-App-60x60@2x.png",
41 | "idiom" : "iphone",
42 | "scale" : "2x",
43 | "size" : "60x60"
44 | },
45 | {
46 | "filename" : "Icon-App-60x60@3x.png",
47 | "idiom" : "iphone",
48 | "scale" : "3x",
49 | "size" : "60x60"
50 | },
51 | {
52 | "filename" : "Icon-App-20x20@1x.png",
53 | "idiom" : "ipad",
54 | "scale" : "1x",
55 | "size" : "20x20"
56 | },
57 | {
58 | "filename" : "Icon-App-20x20@2x-1.png",
59 | "idiom" : "ipad",
60 | "scale" : "2x",
61 | "size" : "20x20"
62 | },
63 | {
64 | "filename" : "Icon-App-29x29@1x.png",
65 | "idiom" : "ipad",
66 | "scale" : "1x",
67 | "size" : "29x29"
68 | },
69 | {
70 | "filename" : "Icon-App-29x29@2x-1.png",
71 | "idiom" : "ipad",
72 | "scale" : "2x",
73 | "size" : "29x29"
74 | },
75 | {
76 | "filename" : "Icon-App-40x40@1x.png",
77 | "idiom" : "ipad",
78 | "scale" : "1x",
79 | "size" : "40x40"
80 | },
81 | {
82 | "filename" : "Icon-App-40x40@2x-1.png",
83 | "idiom" : "ipad",
84 | "scale" : "2x",
85 | "size" : "40x40"
86 | },
87 | {
88 | "filename" : "Icon-App-76x76@1x.png",
89 | "idiom" : "ipad",
90 | "scale" : "1x",
91 | "size" : "76x76"
92 | },
93 | {
94 | "filename" : "Icon-App-76x76@2x.png",
95 | "idiom" : "ipad",
96 | "scale" : "2x",
97 | "size" : "76x76"
98 | },
99 | {
100 | "filename" : "Icon-App-83.5x83.5@2x.png",
101 | "idiom" : "ipad",
102 | "scale" : "2x",
103 | "size" : "83.5x83.5"
104 | },
105 | {
106 | "filename" : "ItunesArtwork@2x.png",
107 | "idiom" : "ios-marketing",
108 | "scale" : "1x",
109 | "size" : "1024x1024"
110 | }
111 | ],
112 | "info" : {
113 | "author" : "xcode",
114 | "version" : 1
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/logo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "logo.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "logo-1.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "author" : "xcode",
20 | "version" : 1
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/logo.imageset/logo-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/logo.imageset/logo-1.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/logo.imageset/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/logo.imageset/logo.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "splash_landscape.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "splash_landscape@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "splash_landscape@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_landscape.imageset/splash_landscape@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "splash_portrait.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "splash_portrait@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "splash_portrait@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait@2x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Gamua/Starling-Framework/2b2759e8d9dfeaa34e5294d93edb3be146f98659/util/ios_asset_project/iOS Asset Project/Assets.xcassets/splash_portrait.imageset/splash_portrait@3x.png
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/ContentView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ContentView.swift
3 | // iOS Icon Project
4 | //
5 | // Created by Daniel Sperl on 23.07.21.
6 | //
7 |
8 | import SwiftUI
9 |
10 | struct ContentView: View {
11 | var body: some View {
12 | Text("Hello, world!")
13 | .padding()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 |
28 | UIApplicationSupportsIndirectInputEvents
29 |
30 | UILaunchStoryboardName
31 | LaunchScreen
32 | UIRequiredDeviceCapabilities
33 |
34 | armv7
35 |
36 | UISupportedInterfaceOrientations
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UISupportedInterfaceOrientations~ipad
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/util/ios_asset_project/iOS Asset Project/iOS_Asset_ProjectApp.swift:
--------------------------------------------------------------------------------
1 | //
2 | // iOS_Icon_ProjectApp.swift
3 | // iOS Icon Project
4 | //
5 | // Created by Daniel Sperl on 23.07.21.
6 | //
7 |
8 | import SwiftUI
9 |
10 | @main
11 | struct iOS_Asset_ProjectApp: App {
12 | var body: some Scene {
13 | WindowGroup {
14 | ContentView()
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/util/transporter_chief/README.md:
--------------------------------------------------------------------------------
1 | Transporter Chief
2 | =================
3 |
4 | *Notice: This tool works on OS X only.*
5 |
6 | The "Transporter Chief" can deploy iOS apps directly to the iPhone or iPad via the command line.
7 | Find out all about the chief in [this article][1] on the Gamua blog.
8 |
9 | [1]: http://gamua.com/blog/2012/03/how-to-deploy-ios-apps-to-the-iphone-via-the-command-line/
10 |
--------------------------------------------------------------------------------