私はキャンバスの中に文字列を描こうとしています。ストリングのテキストと位置は、異なるボトムを押すと変化します。そうするために、私は私がキャンバスに追加スプライトに追加のTextFieldを作成:すべてが正常に動作しますが、私は底を押すと、それは古いテキストフィールドを更新し、表示されません初めてキャンバスに文字列を描く
canvas.rawChildren.addChild(spriteNombres);
をし、古いものを削除することはできません。removeAllChildrenを試してみて、removeChildrenAtで1つずつ削除しようとしています。私は何か間違っているのか、これが最善の方法ではないのか分かりません。
提案がありますか?
ありがとうございます。
また、ビットマップデータを作成し、四角形内のスプライトで描画してみてください。
var channelName: TextField = new TextField();
channelName.text = channelNames[displaySequence[channel]];
if (channelName.text != null) {
channelName.antiAliasType = AntiAliasType.NORMAL;
var theWidth,theHeight:int;
theWidth=0;
theHeight=20;
var bitmapdata:BitmapData = new BitmapData(theWidth, theHeight, true, 0x000000);
bitmapdata.draw(channelName);
spriteNombres.graphics.beginBitmapFill(bitmapdata);
spriteNombres.graphics.drawRect(offsetX, offsetY, theWidth, theHeight);
spriteNombres.graphics.endFill();
}
私の理解から、 rawChildrenコンテナを追加するべきではありません。これには別のタイプのコンテナを使用します。 – sberry