Class: Shape

Shape

ベクターデータを管理するクラス、Next2DのShapeクラスとして出力されます。
The output is as a Next2D Shape class, a class that manages vector data.

new instance.Shape (object)

NameTypeDefaultDescription
objectobjectnull

Extends

  • Instance

Members

bitmapId number

画像の色設定で画像がセットされた際の画像ID
Image ID when the image is set in the image color settings

Default Value:
  • 0

bounds object

表示領域(バウンディングボックス)のObjectを返す
Returns the Object of the display area (bounding box)

Default Value:
  • null

defaultSymbol string readonly

シンボルを指定した時の継承先を返す
Returns the inheritance destination when a symbol is specified.

grid object

9sliceの4点の座標情報
Coordinate information for 4 points of 9slice

Default Value:
  • null

height number readonly

Shapeの高さを返す
Return image width

inBitmap boolean

SWFのShapeで画像が使われているかの判定
Determining if an image is used in a SWF Shape

Default Value:
  • false

recodes array

Shapeの描画のポイント情報を配列で返す
Returns an array of shape drawing point information

width number readonly

Shapeの幅を返す
Return image width

Methods

addPointer (layer_id, character_id, index, x, y, matrix, type, curve)void

指定のxy座標にパスのelementを追加
Add a path element at the specified xy-coordinates

NameTypeDefaultDescription
layer_idnumber
character_idnumber
indexnumber
xnumber
ynumber
matrixarray
typenumber
curvebooleanfalseoptional
Returns:
TypeDescription
void

cacheClear ()void

このオブジェクトが設置されてる全てのDisplayObjectのキャッシュを削除
Delete the cache of all DisplayObjects where this object is located

Returns:
TypeDescription
void

changeColor (color_index)void

色情報を更新
Update color information

NameTypeDefaultDescription
color_indexnumber-1optional
Returns:
TypeDescription
void

changeGradient (index, style, graphics_type, delete_number, color, alpha)void

色設定をグラデーションへ変更
Change color setting to gradient

NameTypeDescription
indexnumber
stylestring
graphics_typenumber
delete_numbernumber
colorobject
alphanumber
Returns:
TypeDescription
void

changeStyle (style)void

Shapeの色設定の変更関数
Function to change the color settings of a Shape

NameTypeDescription
stylestring
Returns:
TypeDescription
void

clone ()MovieClip

Shapeクラスを複製
Duplicate Shape class

Returns:
TypeDescription
MovieClip

copyFrom (shape)Shape

引数のShapeオブジェクトにこのオブジェクトのパス情報をコピーする
Copy the path information of this object to the argument Shape object

NameTypeDescription
shapeShape
Returns:
TypeDescription
Shape

createInstance ()next2d.display.Shape

Next2DのDisplayObjectを生成
Generate Next2D DisplayObject

Returns:
TypeDescription
next2d.display.Shape

createPointer (matrix, layer_id, character_id)void

描画パスのxyポインターを生成
Generate xy pointer for drawing path

NameTypeDescription
matrixarray
layer_idnumber
character_idnumber
Returns:
TypeDescription
void

getBounds (matrix)object

表示領域(バウンディングボックス)のObjectを返す
Returns the Object of the display area (bounding box)

NameTypeDefaultDescription
matrixarraynulloptional
Returns:
TypeDescription
object

reloadBounds (stroke)object

リサイズやパスの座標変更時にバウンディングボックスの座標を再計算
Recalculate bounding box coordinates when resizing or changing path coordinates

NameTypeDefaultDescription
strokenumber0optional
Returns:
TypeDescription
object

setHitColor (x, y, place_matrix)void

マウスダウンしたxy座標にShapeの色があれば、ヒットした色をコントローラーに表示する
If there is a Shape color at the xy-coordinates of the mouse down, display the hit color on the controller.

NameTypeDescription
xnumber
ynumber
place_matrixarray
Returns:
TypeDescription
void

showController (place, name)void

このアイテムが設定されたDisplayObjectが選択された時
内部情報をコントローラーに表示する
When a DisplayObject with this item set is selected,
internal information is displayed on the controller.

NameTypeDefaultDescription
placeobject
namestring""optional
Returns:
TypeDescription
void

showShapeColor (place, event)

タップした範囲のShapeのカラーをコントローラーに表示
Display the color of the shape in the tapped area on the controller

NameTypeDescription
placeobject
eventMouseEvent

toObject ()object

クラス内の変数をObjectにして返す
Return variables in a class as Objects

Returns:
TypeDescription
object

toPublish ()object

書き出し用のObjectを返す
Returns an Object for export

Returns:
TypeDescription
object