Skip to content

hist/Hello-Starling

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Starling

Demos of Starling Framework.

Why it

  • You can see all demos in one application based on XFace.
  • You can view all source code in one project code base and edit it for trying easily.
  • You can add your demos or code pieces for studying easily too.

NOTE

  • Add “-swf-version=13” to your Compiler Arguments.
  • Run “bin/HelloStarling.html” instead of “bin/HelloStarling.swf”.

Demos

Add your own code

Create your own demo

package starling_demos
{
    public class YourDemo extends StarlingDemoBase
    {
        [Test]
        public function test():void
        {
            // Your demo code here.
        }
    }
}

StarlingDemoBase injected an Starling instance and root container for you, you can free your demo class from extending it by injecting them yourself if needed.

package starling_demos
{
    import starling.core.Starling;
    import starling.display.DisplayObject;
    import starling.display.DisplayObjectContainer;

    public class StarlingDemoBase
    {
        [Inject]
        public var root:DisplayObjectContainer;
        [Inject]
        public var starling:Starling;

        protected function display(child:DisplayObject, x:Number = 0, y:Number = 0):void
        {
            child.x = x;
            child.y = y;
            root.addChild(child);
        }
    }
}

Add your demo to demo suite class

package starling_demos
{
    import starling_demos.jamesli.JamesliDemos;
    import starling_demos.official.OfficialDemos;

    [Suite]
    public class AllStarlingDemos
    {
        public static function suite():Array
        {
            return [

                YourDemo, 

                JamesliDemos,
                OfficialDemos,
            ];
        }
    }
}

About

Demos of Starling Framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ActionScript 85.3%
  • JavaScript 13.0%
  • HTML 1.6%
  • CSS 0.1%