SwfBuilder class
テスト用の合成SWFフィクスチャビルダー。
SwfParserが読める最小限の形式でタグを組み立てる。実SWF(著作物)に 依存するテストを、このビルダーが生成する合成SWFへ置き換えるための基盤。
Constructors
- SwfBuilder({int version = 4, int widthPx = 240, int heightPx = 240, double frameRate = 12})
-
version・ステージサイズ(widthPxxheightPx)・frameRateを指定して ビルダーを生成する。既定値はテストで一般的に使う最小構成。
Properties
- frameRate → double
-
フレームレート(fps)。buildで8.8固定小数点(値×256をUI16化)としてヘッダに書き込む。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heightPx → int
-
ステージ高さ(px単位)。buildでtwipsへ換算しヘッダのRECT(フレームサイズ)に書き込む。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → int
-
SWFファイルバージョン(ヘッダの版数バイトに書き込まれる)。
buildCompressedはこれが6未満の場合に組み立てを拒否する。
final
- widthPx → int
-
ステージ幅(px単位)。buildでtwipsへ換算しヘッダのRECT(フレームサイズ)に書き込む。
final
Methods
-
build(
) → Uint8List - FWSヘッダ + 蓄積したタグ列 + Endタグ。
-
buildCompressed(
) → Uint8List - buildのCWS(zlib圧縮SWF)版。
-
defineButton(
int id, {required int keyPress, required Uint8List actions, int? shapeId}) → void -
DefineButton2(タグ34)。CondKeyPress=
keyPressのButtonCondAction 1個と、shapeId指定時はヒット/アップ兼用のButtonRecordを持つボタンを定義する。 -
defineShapeRect(
int id, {required int widthPx, required int heightPx, int fillRgb = 0x000000}) → void - 単色塗りの矩形シェイプをDefineShape(タグ2/バージョン1)として定義する。
-
defineSprite(
int id, void build(SwfBuilder sprite)) → void -
DefineSprite(タグ39)。
buildでスプライト内タイムラインをネストビルドする。 -
doAction(
Uint8List bytecode) → void -
DoAction(タグ12)。
bytecode(Asm等で組み立てたActionRecord列。末尾にオペコード 0x00の終端バイトを含む想定)をそのままタグボディとして書き込む。 -
frameLabel(
String label) → void -
FrameLabel(タグ43)。現在フレームに付ける
labelをSJISのnull終端文字列としてボディに 書き込む。 -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
placeObject2(
{required int depth, int? characterId, int? translateXPx, int? translateYPx, String? name}) → void -
PlaceObject2(タグ26)。指定
depthにキャラクターを配置または既存インスタンスを更新する。 -
removeObject2(
{required int depth}) → void -
RemoveObject2(タグ28)。指定
depthに配置中のインスタンスを取り除く。 ボディはDepth(UI16)のみ。 -
setBackgroundColor(
int r, int g, int b) → void -
SetBackgroundColor(タグ9)。背景色を
r・g・b(各0-255)の順にUI8 3byteとして タグボディへそのまま書き込む。 -
showFrame(
) → void - ShowFrame(タグ1)。ボディなし(0byte)のタグを書き込み現在のフレームを確定させ、 内部フレームカウントを1つ進める。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited