0
我有多邊形說(六角形有6條線)這個六角形連接從中心與6點這使得6個三角形 我需要當移動任何點(導致移動三角形),其他點移動像這個點我的意思是如果左點動解除其他點向左移動等如何根據一點的移動移動多邊形點?
我想這樣ptcP1.x和ptcP1.y點我移動它的其他點移動代碼依賴於ptcP1運動需要注意的是,這個公式做工精細在方形,,放在五角和六..等這個方程有效,以便任何人可以幫助我
function button1_triggeredHandler(event:Event):void
{
mode="mode2";
//trace(list.selectedIndex);
if(list.selectedIndex==1)
{
DrawSqure.ptcP1.x = Math.random() + 50;
DrawSqure.ptcP1.y = Math.random() + 50;
DrawSqure.ptcP2.y = 50-DrawSqure.ptcP1.x;
DrawSqure.ptcP2.x = DrawSqure.ptcP1.y;
DrawSqure.ptcP3.x = 50-DrawSqure.ptcP1.y;
DrawSqure.ptcP3.y = DrawSqure.ptcP1.x;
DrawSqure.ptcP4.x = 50-DrawSqure.ptcP1.x;
DrawSqure.ptcP4.y = 50-DrawSqure.ptcP1.y;
}
爲什麼不保存該對象的所有點的數組,並且當某個點正在移動時 - 將新位置(平移)應用於所有點? –
你是在時間軸上做這個嗎? @Creative Magic的解決方案也可以工作。 –