ゼットコードログ

コード的な何かを書いていきます。

OpenFLのサンプルプログラムを手に入れる

手始めに、サンプルになりそうなコードはどこかにないものか? OpenFLをインストールしたら、次のコマンドを実行することでサンプルプロジェクトが生成されます。 まずは、どのようなサンプルが入っているのか見てみましょう。

$ lime create openfl

にょろっと次のように出てきます。

You must specify a template when using the 'create' command.

Usage: lime create openfl:project "com.package.name" "OutputDirectory"
Usage: lime create openfl:(sample) "OutputDirectory"
Usage: lime create extension "ExtensionName"

Available Templates:

* openfl:project
* openfl:ActuateExample
* openfl:AddingAnimation
* openfl:AddingText
* openfl:BunnyMark
* openfl:DisplayingABitmap
* openfl:HandlingKeyboardEvents
* openfl:HandlingMouseEvents
* openfl:HerokuShaders
* openfl:PiratePig
* openfl:PlayingSound
* openfl:SimpleBox2D
* openfl:SimpleOpenGLView
* openfl:SimpleSWFLayout
* extension

「project」と「extension」以外がサンプルですね。 見たいサンプルを指定して実行すると、にょろっとサンプルプロジェクトのひな形を作ってくれます。

$ lime create openfl:ActuateExample
$ cd ActuateExample
$ lime build project.xml html5
$ lime run html5

すべてのサンプルを見たいんだけど、コマンドをいちいち打つのが面倒だと思っていたら GitHubに同じものがあった!!git cloneしてしまったほうが速いかもしれません。

openfl/openfl-samples · GitHub