Class: DisplayObjectContainer

DisplayObjectContainer

DisplayObjectContainer クラスは、表示リストで表示オブジェクトコンテナとして機能するすべてのオブジェクトの基本クラスです。
このクラス自体は、画面上でのコンテンツの描画のための API を含みません。
そのため、DisplayObject クラスのカスタムサブクラスを作成する場合は、
Sprite、または MovieClip など、画面上にコンテンツを描画する API を持つサブクラスの 1 つを拡張する必要があります。

The DisplayObjectContainer class is the base class for all objects that can serve
as display object containers on the display list.
This class itself does not contain any API for drawing content on the screen.
Therefore, if you want to create a custom subclass of the DisplayObject class,
you need to extend one of its subclasses that has an API for drawing content on the screen,
such as Sprite or MovieClip.

new next2d.display.DisplayObjectContainer ()

Extends

  • InteractiveObject

Members

next2d.display.DisplayObjectContainer.namespace staticconstant

指定されたクラスの空間名を返します。
Returns the space name of the specified class.

Default Value:
  • next2d.display.DisplayObjectContainer

mouseChildren boolean

オブジェクトの子がマウスまたはユーザー入力デバイスに対応しているかどうかを判断します。
Determines whether or not the children of the object are mouse, or user input device, enabled.

namespace constant

指定されたオブジェクトの空間名を返します。
Returns the space name of the specified object.

Default Value:
  • next2d.display.DisplayObjectContainer

numChildren number readonly

このオブジェクトの子の数を返します。
Returns the number of children of this object.

Methods

next2d.display.DisplayObjectContainer.toString ()string static

指定されたクラスのストリングを返します。
Returns the string representation of the specified class.

Default Value:
  • [class DisplayObjectContainer]
Returns:
TypeDescription
string

addChild (child)DisplayObject

この DisplayObjectContainer インスタンスに子 DisplayObject インスタンスを追加します。
Adds a child DisplayObject instance to this DisplayObjectContainer instance.

NameTypeDescription
childDisplayObject
Returns:
TypeDescription
DisplayObject

addChildAt (child, index)DisplayObject

この DisplayObjectContainer インスタンスに子 DisplayObject インスタンスを追加します。
Adds a child DisplayObject instance to this DisplayObjectContainer instance.

NameTypeDescription
childDisplayObject
indexnumber
Returns:
TypeDescription
DisplayObject

contains (child)boolean

指定された表示オブジェクトが、DisplayObjectContainer インスタンスの子であるか
インスタンス自体であるかを指定します。
Determines whether the specified display object is a child
of the DisplayObjectContainer instance or the instance itself.

NameTypeDescription
childDisplayObject
Returns:
TypeDescription
boolean

getChildAt (index)DisplayObject

指定のインデックス位置にある子表示オブジェクトインスタンスを返します。
Returns the child display object instance that exists at the specified index.

NameTypeDescription
indexnumber
Returns:
TypeDescription
DisplayObject

getChildByName (name)Object | null

指定された名前に一致する子表示オブジェクトを返します。
Returns the child display object that exists with the specified name.

NameTypeDescription
namestring
Returns:
TypeDescription
Object | null

getChildIndex (child)number

子 DisplayObject インスタンスのインデックス位置を返します。
Returns the index position of a child DisplayObject instance.

NameTypeDescription
childDisplayObject
Returns:
TypeDescription
number

removeChild (child)DisplayObject

DisplayObjectContainer インスタンスの子リストから指定の
child DisplayObject インスタンスを削除します。
Removes the specified child DisplayObject instance from the
child list of the DisplayObjectContainer instance.

NameTypeDescription
childDisplayObject
Returns:
TypeDescription
DisplayObject

removeChildAt (index)DisplayObject

DisplayObjectContainer の子リストの指定された index 位置から子 DisplayObject を削除します。
Removes a child DisplayObject from the specified index position
in the child list of the DisplayObjectContainer.

NameTypeDescription
indexnumber
Returns:
TypeDescription
DisplayObject

removeChildren (begin_index, end_index)void

DisplayObjectContainer インスタンスの子リストから
すべての child DisplayObject インスタンスを削除します。
Removes all child DisplayObject instances from
the child list of the DisplayObjectContainer instance.

NameTypeDefaultDescription
begin_indexnumber0optional
end_indexnumber0x7fffffffoptional
Returns:
TypeDescription
void

setChildIndex (child, index)void

表示オブジェクトコンテナの既存の子の位置を変更します。
Changes the position of an existing child in the display object container.

NameTypeDescription
childDisplayObject
indexnumber
Returns:
TypeDescription
void

swapChildren (child1, child2)void

指定された 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。
Swaps the z-order (front-to-back order) of the two specified child objects.

NameTypeDescription
child1DisplayObject
child2DisplayObject
Returns:
TypeDescription
void

swapChildrenAt (index1, index2)void

子リスト内の指定されたインデックス位置に該当する 2 つの子オブジェクトの z 順序(重ね順)を入れ替えます。
Swaps the z-order (front-to-back order) of the child objects at
the two specified index positions in the child list.

NameTypeDescription
index1number
index2number
Returns:
TypeDescription
void

指定されたオブジェクトのストリングを返します。
Returns the string representation of the specified object.

Default Value:
  • [object DisplayObjectContainer]
Returns:
TypeDescription
string