Class: DisplayObject

DisplayObject

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

The DisplayObject class is the base class for all objects that can be placed on the display list.
The DisplayObject class itself does not include any APIs for rendering content onscreen.
For that reason, if you want create a custom subclass of the DisplayObject class,
you will want to extend one of its subclasses that do have APIs for rendering content onscreen,
such as the Shape, Sprite, Bitmap, TextField, or MovieClip class.

new next2d.display.DisplayObject ()

Extends

  • EventDispatcher

Members

next2d.display.DisplayObject.namespace staticconstant

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

Default Value:
  • next2d.display.DisplayObject

alpha number

指定されたオブジェクトのアルファ透明度値を示します。
有効な値は 0.0(完全な透明)~ 1.0(完全な不透明)です。
デフォルト値は 1.0 です。alpha が 0.0 に設定されている表示オブジェクトは、
表示されない場合でも、アクティブです。
Indicates the alpha transparency value of the object specified.
Valid values are 0.0 (fully transparent) to 1.0 (fully opaque).
The default value is 1.0. Display objects with alpha set to 0.0 are active,
even though they are invisible.

Default Value:
  • 1

blendMode string

使用するブレンドモードを指定する BlendMode クラスの値です。
A value from the BlendMode class that specifies which blend mode to use.

Default Value:
  • BlendMode.NORMAL

filters array

表示オブジェクトに現在関連付けられている各フィルターオブジェクトが
格納されているインデックス付きの配列です。
An indexed array that contains each filter object
currently associated with the display object.

Default Value:
  • {array}

height number

表示オブジェクトの高さを示します(ピクセル単位)。
Indicates the height of the display object, in pixels.

loaderInfo LoaderInfo readonly

この表示オブジェクトが属するファイルの読み込み情報を含む LoaderInfo オブジェクトを返します。
Returns a LoaderInfo object containing information
about loading the file to which this display object belongs.

mask DisplayObject | null

呼び出し元の表示オブジェクトは、指定された mask オブジェクトによってマスクされます。
The calling display object is masked by the specified mask object.

mouseX number readonly

マウスまたはユーザー入力デバイスの x 軸の位置をピクセルで示します。
Indicates the x coordinate of the mouse or user input device position, in pixels.

Default Value:
  • 0

mouseY number readonly

マウスまたはユーザー入力デバイスの y 軸の位置をピクセルで示します。
Indicates the y coordinate of the mouse or user input device position, in pixels.

Default Value:
  • 0

name string

DisplayObject のインスタンス名を示します。
Indicates the instance name of the DisplayObject.

namespace constant

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

Default Value:
  • next2d.display.DisplayObject

parent DisplayObjectContainer | null readonly

この表示オブジェクトを含む DisplayObjectContainer オブジェクトを示します。
Indicates the DisplayObjectContainer object that contains this display object.

root DisplayObject | null readonly

読み込まれた SWF ファイル内の表示オブジェクトの場合、
root プロパティはその SWF ファイルが表す表示リストのツリー構造部分の一番上にある表示オブジェクトとなります。
For a display object in a loaded SWF file,
the root property is the top-most display object
in the portion of the display list's tree structure represented by that SWF file.

rotation number

DisplayObject インスタンスの元の位置からの回転角を度単位で示します。
Indicates the rotation of the DisplayObject instance,
in degrees, from its original orientation.

scale9Grid Rectangle

現在有効な拡大 / 縮小グリッドです。
The current scaling grid that is in effect.

scaleX number

基準点から適用されるオブジェクトの水平スケール(パーセンテージ)を示します。
Indicates the horizontal scale (percentage)
of the object as applied from the registration point.

scaleY number

基準点から適用されるオブジェクトの垂直スケール(パーセンテージ)を示します。
IIndicates the vertical scale (percentage)
of an object as applied from the registration point.

stage Stage readonly

表示オブジェクトのステージです。
The Stage of the display object.

transform Transform

表示オブジェクトのマトリックス、カラー変換、
ピクセル境界に関係するプロパティを持つオブジェクトです。
An object with properties pertaining
to a display object's matrix, color transform, and pixel bounds.

visible boolean

表示オブジェクトが可視かどうかを示します。
Whether or not the display object is visible.

width number

表示オブジェクトの幅を示します(ピクセル単位)。
Indicates the width of the display object, in pixels.

x number

親 DisplayObjectContainer のローカル座標を基準にした
DisplayObject インスタンスの x 座標を示します。
Indicates the x coordinate
of the DisplayObject instance relative to the local coordinates
of the parent DisplayObjectContainer.

y number

親 DisplayObjectContainer のローカル座標を基準にした
DisplayObject インスタンスの y 座標を示します。
Indicates the y coordinate
of the DisplayObject instance relative to the local coordinates
of the parent DisplayObjectContainer.

Methods

next2d.display.DisplayObject.toString ()string static

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

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

clearGlobalVariable ()void

グローバル変数空間に値を全てクリアします。
Clear all values in the global variable space.

Returns:
TypeDescription
void

deleteGlobalVariable (key)void

グローバル変数空間の値を削除
Remove values from global variable space.

NameTypeDescription
key*
Returns:
TypeDescription
void

deleteLocalVariable (key)void

クラスのローカル変数空間の値を削除
Remove values from the local variable space of a class

NameTypeDescription
key*
Returns:
TypeDescription
void

getBounds (target)Rectangle

targetCoordinateSpace オブジェクトの座標系を基準にして、
表示オブジェクトの領域を定義する矩形を返します。
Returns a rectangle that defines the area
of the display object relative to the coordinate system
of the targetCoordinateSpace object.

NameTypeDefaultDescription
targetDisplayObjectnulloptional
Returns:
TypeDescription
Rectangle

getGlobalVariable (key)*

グローバル変数空間から値を取得
Get a value from the global variable space

NameTypeDescription
key*
Returns:
TypeDescription
*

getLocalVariable (key)*

クラスのローカル変数空間から値を取得
Get a value from the local variable space of the class

NameTypeDescription
key*
Returns:
TypeDescription
*

globalToLocal (point)Point

point オブジェクトをステージ(グローバル)座標から
表示オブジェクトの(ローカル)座標に変換します。
Converts the point object from the Stage (global) coordinates
to the display object's (local) coordinates.

NameTypeDescription
pointPoint
Returns:
TypeDescription
Point

hasGlobalVariable (key)boolean

グローバル変数空間に値があるかどうかを判断します。
Determines if there is a value in the global variable space.

NameTypeDescription
key*
Returns:
TypeDescription
boolean

hasLocalVariable (key)boolean

クラスのローカル変数空間に値があるかどうかを判断します。
Determines if there is a value in the local variable space of the class.

NameTypeDescription
key*
Returns:
TypeDescription
boolean

hitTestObject (object)boolean

表示オブジェクトの境界ボックスを評価して、
obj 表示オブジェクトの境界ボックスと重複または交差するかどうかを調べます。
Evaluates the bounding box of the display object to see
if it overlaps or intersects with the bounding box of the obj display object.

NameTypeDescription
objectDisplayObject
Returns:
TypeDescription
boolean

hitTestPoint (x, y, shape_flag)boolean

表示オブジェクトを評価して、x および y パラメーターで指定された
ポイントと重複または交差するかどうかを調べます。
Evaluates the display object to see if it overlaps
or intersects with the point specified by the x and y parameters.

NameTypeDefaultDescription
xnumber
ynumber
shape_flagbooleanfalseoptional
Returns:
TypeDescription
boolean

localToGlobal (point)Point

point オブジェクトを表示オブジェクトの(ローカル)座標から
ステージ(グローバル)座標に変換します。
Converts the point object from the display object's (local) coordinates
to the Stage (global) coordinates.

NameTypeDescription
pointPoint
Returns:
TypeDescription
Point

setGlobalVariable (key, value)void

グローバル変数空間へ値を保存
Save values to global variable space

NameTypeDescription
key*
value*
Returns:
TypeDescription
void

setLocalVariable (key, value)void

クラスのローカル変数空間へ値を保存
Store values in the local variable space of the class

NameTypeDescription
key*
value*
Returns:
TypeDescription
void

toString ()string

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

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