Java を使用して Processing 2.0 ソフトウェアに取り組んでいるときに問題に遭遇しました。アニメーションを追加するたびに、背景も追加して、このアニメーションの前のフレームを消去します。残念ながら、このプロセスでは残りのグラフィックも消去されます。新しい背景を追加せずに PShape をアニメーション化する方法はありますか? または、一般的に形状をアニメーション化するより良い方法はありますか? また、私は ActionScript 言語を使用しており、アニメーションに対する私の理解は MovieClip に基づいていることにも言及したいと思います。
ありがとう。
編集:以下に追加されたコード:
アプリケーション エントリ ポイント
LineManager lineManager;
Character character;
void setup() {
size( 300, 600 );
background( 50 );
rectMode( CENTER );
frameRate( 24 );
lineManager = new LineManager();
character = new Character();
}
void draw() {
character.onTick();
}
文字クラス
public class Character {
float MIN_VALUE = 80;
float value = MIN_VALUE;
float radius = 50.0;
int X, Y;
int nX, nY;
int delay = 16;
PShape player;
public Character() {
X = width / 2;
Y = height / 2;
nX = X;
nY = Y;
player = loadShape("player.svg");
}
public void onTick() {
value = value + sin( frameCount/4 );
X += (nX-X)/delay;
Y += (nY-Y)/delay;
/*
** My issue is the line below, as when adding it to render the animation
** I end up hiding the rest of my graphics
*/
background(0);
ellipse( X, Y, value, value );
shape( player, -10, 140, 320, 320 );
fill( 222, 222, 222, 222 );
}
}