Code Monkey home page Code Monkey logo

hello-starling's Introduction

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,
            ];
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.