Skin for ANeko

Introduction

ANeko用のスキン。見た目を変更する。


DroidSkin for ANeko

ドロイドくん

Requirements

ANeko v0.1.1 以降

Download

Android app on Google Play
Google Play からダウンロード

Source code is available on GitHub

Changes


How to create skin

Skin is packaged as APK file.

Prerequisites

Import sample to Eclipse

  1. Download sample project.
  2. Copy skin/sample/ directory to workspace.
  3. File > Import... > Existing Project into Workspace.
  4. Choose copied directory, then press Finish.
  5. In the package pane, choose src > com.example.aneko.sample.
  6. Choose Refactor > Rename from right click menu.
  7. Enter new package name and check `Update fully qualified names in non-Java text files', then press Preview.
  8. Uncheck `SkinActivity.java' and `Android Package Rename', then press OK

Edit skin data

Skin data XML

<motion-params>
Defines the skin data.
This must be the root element. Contains one or more <motion> elements.
acceleration
Integer. [dp/sec2]
Acceleration rate for moving from stopped state or changing movement direction.
maxVelocity
Integer. [dp/sec]
Maximum velocity for moving state.
deaccelerationDistance
Integer. [dp]
Threshold distance between moving destination and current position to deaccelerate velocity. When distance less than this value, maximum velocity will decrease in proportion to distance.
proximityDistance
Integer. [dp]
Threshold distance between moving destination and current position to stop moving. When distance less than this value, movement will stop.
initialState
String.
Name of initial and stopped state. This state is used when first time and movement is stopped.
awakeState
String.
Name of starting to move state from stopped state. This state is used when user touches display in stopped state.
moveStatePrefix
String.
Prefix of moving state name. Name of state will be generated from this value by appending direction.
Direction is one of follow: Up, Down, Left, Right, UpLeft, UpRight, DownLeft, DownRight
wallStatePrefix
String. (optional)
Prefix of left edge and right edge state name. These states are used when stopped at left edge or right edge of display. Name of state will be generated from this value by appending direction.
Direction is one of follow: Left, Right
<motion>
Defines a state to describe animation.
Must be a child of <motion-params> element. Contains <item> and/or <repeat-item> elements.
state
String.
Name of this state. States are distinguished and referenced by this name.
duration
Integer. [millisec] (optional)
Duration of this state. When the duration passed, current state transition to next state. If this attribute is omitted or negative value is set, duration is equivalent to total duration of inner animations.
nextState
String. (optional)
Name of next state. When the duration passed, current state transition to specified state.
If checkMove and/or checkWall is true and satisfy condition, this attribute value will not be used.
checkMove
Boolean. (optional)
If set to true and when need to move, next state is moving state.
See: moveStatePrefix
checkWall
Boolean. (optional)
If set to true and current position is left edge or right edge of display, next state is display edge state.
See: wallStatePrefix
<item>
Defines a frame of animation.
Must be a child of <motion> or <repeat-item> element.
drawable
Reference to drawable resource.
An image of frame.
duration
Integer. [millisec] (optional)
Duration of this frame. If this attribute is omitted or negative value is set, duration is equivalent to infinity.
<repeat-item>
Defines one or more frames. These frames can be repeat once or more times.
Must be a child of <motion> or <repeat-item> element. Contains <item> and/or <repeat-item> elements.
duration
Integer. [millisec] (optional)
Duration of frames. If this attribute is omitted or negative value is set, duration is equivalent to total duration of inner animations.
repeatCount
Integer. (optional)
Number of repeat count. If this attribute is omitted or negative value is set, animation repeats infinity.

Publishing

Publishing process of skin package is same as normal Android application.
For more details, see Dev Guide of Android
If you publish skin to Google Play, it is recommended to include keywords `ANeko' and `skin' into application name or description for searching.


スキンの作り方

スキンはAPKファイルとしてパッケージ化される。

前準備

サンプルを Eclipse へインポート

  1. サンプルプロジェクトをダウンロード。
  2. skin/sample/ ディレクトリを作業場所にコピー。
  3. File > Import... > Existing Project into Workspace.
  4. コピーしたディレクトリを選択し、Finish を押す。
  5. Package ペインで src > com.example.aneko.sample を選択。
  6. 右クリックメニューから Refactor > Rename 選択。
  7. 新しいパッケージ名を入力し、「Update fully qualified names in non-Java text files」をチェックして、Preview を押す。
  8. SkinActivity.java」と「Android Package Rename」のチェックを外し、OK を押す。

スキンデータの編集

スキンデータ XML

<motion-params>
スキンデータを定義する。
ルート要素でなければならない。1つ以上の <motion> 要素を持つことができる。
acceleration
整数。[dp/sec2]
停止状態から移動する時、または移動方向を変更する時の加速度。
maxVelocity
整数。[dp/sec]
移動状態での最大速度。
deaccelerationDistance
整数。[dp]
減速を開始する閾値となる移動目的地から現在位置までの距離。距離がこの値よりも小さい場合、最大速度は距離に比例して小さくなる。
proximityDistance
整数。[dp]
移動を停止する閾値となる移動目的地から現在位置までの距離。距離がこの値よりも小さい場合、移動は停止する。
initialState
文字列。
初期状態と停止状態の名前。この状態は最初と、移動から停止した時に使用される。
awakeState
文字列。
停止状態から移動を開始する時の状態名。この状態は停止状態にユーザーがディスプレイをタッチした時に使用される。
moveStatePrefix
文字列。
移動状態名の接頭辞。状態名はこの値に方向を追加して生成される。
方向は次のいずれか: UpDownLeftRightUpLeftUpRightDownLeftDownRight
wallStatePrefix
文字列。(任意)
左端状態名と右端状態名。この状態は画面の左端か右端で停止した場合に使用される。状態名はこの値に方向を追加して生成される。
方向は次のいずれか: LeftRight
<motion>
アニメーションする各状態を定義する。
<motion-params> 要素の子要素でなければならない。<item><repeat-item> 要素を持つことができる。
state
文字列。
状態名。各状態はこの名前で区別、参照される。
duration
整数。[millisec] (任意)
この状態の継続時間。継続時間が過ぎると、現在の状態は次の状態へと遷移する。この属性を省略または負の値を設定した場合、持続時間は内包するアニメーションの累計時間と同等。
nextState
文字列。(任意)
次状態名。継続時間が過ぎた時、現在の状態は指定された状態へと遷移する。
checkMove または checkWalltrue で、条件が満たされている場合は、この属性値は使用されない。
checkMove
真偽値。(任意)
true が設定されていて移動する必要がある場合、次の状態は移動状態となる。
参照: moveStatePrefix
checkWall
真偽値。(任意)
true が設定されていて、現在の位置が画面の左端か右端の場合、次の状態は画面端状態となる。
参照: wallStatePrefix
<item>
アニメーションのフレームを定義する。
<motion> または <repeat-item> 要素の子要素でなければならない。
drawable
drawable リソースへの参照。
フレームの画像。
duration
整数。[millisec] (任意)
フレームの継続時間。この属性を省略または負の値を設定した場合、継続時間は無限となる。
<repeat-item>
1枚以上のフレームを定義する。指定したフレームは1回以上繰り返すことができる。
<motion> または <repeat-item> 要素の子要素でなければならない。<item><repeat-item> 要素を持つことができる。
duration
整数。[millisec] (任意)
フレームの継続時間。この属性を省略または負の値を設定した場合、持続時間は内包するアニメーションの累計時間と同等。
repeatCount
整数。(任意)
繰り返し回数。この属性を省略または負の値を設定した場合、アニメーションは無限に繰り返す。

公開

スキンパッケージの公開方法は通常の Android アプリケーションと同様。
詳細は Android の Dev Guide を参照。
スキンを Android マーケットに公開する場合は、検索のためにアプリケーション名または説明文に「ANeko」と「skin」を含めることを推奨。



webmaster@tamanegi.org
more...