Giter VIP home page Giter VIP logo

acanvas / acanvas-generator Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 41.92 MB

Generate Acanvas projects for Dart 2.0 and StageXL. With Acanvas, you quickly write web apps, minigames, or anything in-between, in pure Dart. No HTML, no CSS, no JS.

License: BSD 3-Clause "New" or "Revised" License

Dart 73.60% Smarty 0.23% Batchfile 0.03% CSS 0.48% HTML 5.05% PHP 16.98% Shell 0.20% PLSQL 3.44%

acanvas-generator's Introduction

Acanvas Generator

Coverage Status Travis Build Status Appveyor Build Status

Acanvas Generator lets you generate Acanvas projects for Dart 2.0 and StageXL. With Acanvas, you quickly write web apps, minigames, or anything in-between, in pure Dart. No HTML, no CSS, no JS.

Acanvas Banner

Acanvas is a layered architecture originally conceived for Actionscript, and has been used in dozens of highly interactive microsites and facebook apps for brands such as Mercedes-Benz, Nike, Nikon, serving millions of pageviews. Learn more.

Acanvas Examples

Installation

Make sure you have an up-to-date Dart 2.0 SDK installed.

$> pub global activate --source git https://github.com/acanvas/acanvas-generator

This puts the executable acgen on your path.

Usage

Basic Project

This is how you create the most basic Acanvas skeleton in your current directory:

# directory name serves as project name
$> mkdir fancy-name
$> cd fancy-name
$> acgen project

The basic project skeleton will give you:

  • Directory structure according to Dart specs.
  • Best practice index.html.
  • Best practice StageXL bootstrap.
  • Best practice Acanvas framework bootstrap.
  • Acanvas framework's state and screen extensions.
  • Dart2JS size: 120 KiB gzipped.
  • Deployment-ready.

Advanced Project

For a list of optional plugins and examples to install, type:

$> acgen project --help

Following plugins are available:

  • material: Material Design reference library
  • google: Full access to Google APIs
  • facebook Plugin: Full access to Facebook APIs
  • physics: Physics engine based on Box2D
  • ugc: Persist User Generated Content and create leaderboards (work in progress)
  • bitmapFont: Add BitmapFont Extension to StageXL
  • dragonBones: Add Dragonbones Extension to StageXL
  • flump: Add Flump Extension to StageXL
  • gaf: Add GAF Extension to StageXL
  • spine: Add Spine Extension to StageXL

Advanced Project Examples

Additionally, you can choose to install example pages:

  • materialExamples: Material Design reference library

  • googleExamples: Full access to Google APIs

  • facebookExamples Plugin: Full access to Facebook APIs

  • physicsExamples: Physics engine based on Box2D

  • ugcExamples: Persist User Generated Content and create leaderboards

  • bitmapFontExamples: Install BitmapFont Examples

  • dragonBonesExamples: Install Dragonbones Examples

  • flumpExamples: Install Flump Examples

  • gafExamples: Install GAF Examples

  • spineExamples: Install Spine Examples

    one plugin and examples

    $> acgen project--material --materialExamples

    all plugins and examples

    $> acgen project --material --materialExamples --google --googleExamples --facebook --facebookExamples --physics --physicsExamples --ugc --ugcExamples --bitmapFont --bitmapFontExamples --dragonBones --dragonBonesExamples --flump --flumpExamples --gaf --gafExamples --spine --spineExamples

Final Step

Finally, run pub:

$> pub get
$> pub global activate webdev
$> webdev serve

See, your project is up and running!

Project Helpers

A fast way to create classes and link them into your project.

# Create a Command
$> acgen command --name MyCommand

# Create a Screen
$> acgen screen --name MyScreen

# Create a view Element
$> acgen element --name MyElement

# Collect Assets into Autoloader
$> acgen collect

Notes for generator developers

(that's me)

Generator was built in a way that the 'master' template under templates/master/ can be directly opened as an IDEA project, with all plugins and examples activated, in order to allow for easy develop/debug of the master template. This decision stems from experience, and is less error prone than having to generate a project and merge back the changes (especially since package names will differ as well as content that has been auto-injected).

Inner workings:

  • Before pushing a new version, you need to run dart tool/grind.dart to generate Lists of String with the file uri's of the assets that need to end up in the target directory.
  • Upon project generation, this array will get iterated over, and the files will be loaded via the Resource package, which is the only way to access files when running scripts via pub.
  • Additionally, some file manipulation will be done according to command line options. Basically, the master template, where all options are switched ON, will get stripped from every plugin and example that is not explicitly activated via command line options.
  • The generated project sports a builder, which collects all properties string from lib/config/ directory and merge them into web/config whenever 'webdev serve' or 'webdev build' is run.

To summarize, these steps are advised before pushing an update to github:

# Remember to run the conversion before submitting:
$> dart tool/grind.dart

# You can test locally with
$> dart tool/grind.dart test

acanvas-generator's People

Contributors

nilsdoehring avatar

Stargazers

Shalom Friss avatar Curtis Chang avatar Serhii Shyran avatar  avatar Rodrigo Muniz avatar dennougorilla avatar Ron Lobo avatar JPLabs avatar Ritchie Young avatar Stanislav avatar

Watchers

James Cloos avatar  avatar

Forkers

sshyran

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.