Adobe Fireworks CS3 Extending Fireworks の dom.addNewStar() にハマり中
dom.addNewStar - Google 検索 がウェブ全体から探しても5件しかありません。PDFの Extending Fireworks 内の検索結果と同じ数しかないってどんだけ。。。
Fireworks のコマンドで遊びほうけているのですが、addNewStar メソッドの結果にはまっています。
PDFの中は、
dom.addNewStar() Availability Fireworks 3 Usage dom.AddNewStar(numSides, spikiness, bIsStar, centerPoint, outsidePoint) Arguments numSides An integer that specifies the number of sides of the new path. spikiness A floating-point value that controls the regularity of the star or polygon. Pass -1 to have Fireworks calculate a good value, or pass a value between 0 and 1 for manual control. bIsStar If bIsStar is true, a star with the specified number of points is created. If it is false, a regular polygon with the specified number of sides is created. centerPoint Specifies the center point of the star or polygon (see “Point data type” on page 6). outsidePoint Specifies a point on the radius of the star or polygon. Returns Nothing. Description Adds a new star- or polygon-shaped path. Example The following command adds a five-sided star: fw.getDocumentDOM().addNewStar(5, -1, true, {x:186, y:72}, {x:265, y:89});
こんな感じになっているわけで、centerPoint は中心点だからいいとして、outsidePoint がよくわかりません。
出来上がりのサイズを別途選択中のオブジェクトにあわせたいのですが、fw.selection[0].width と fw.selection[0].height にしてみても、狙った結果になりません(半径を指定するようなので当たり前と言えば当たり前。。。)
どうやら outsidePoint は、addNewStar した際の引数に応じて自動計算されたサイズで出力されるのですが、numSides の数が違うだけでサイズが異なってしまうので、コマンドで使う前提(≒プログラム的に動的に狙った値にしたい)にうまくマッチしてないようです。
他の手立てがないこともないのですが、もうちょっとなんとかならないもんかなぁと。
Fireworks 使いで、GURUのコピーとかじゃなくて、jsfでコマンドを作る人とお近づきになりたい今日この頃です。。。