DOMPointReadOnly: DOMPointReadOnly() コンストラクター
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
DOMPointReadOnly()
コンストラクターは、スクリプトコードによってその値を変更できない、 2D または 3D の点を表す新しい DOMPointReadOnly
オブジェクト(オプションで遠近法を使用可能)を返します。
構文
js
new DOMPointReadOnly()
new DOMPointReadOnly(x)
new DOMPointReadOnly(x, y)
new DOMPointReadOnly(x, y, z)
new DOMPointReadOnly(x, y, z, w)
引数
返値
空間内の指定された位置を表す、新しい DOMPointReadOnly
オブジェクト。
例
次のコードは、 2D または 3D の点を作成する例です。
js
const point2D = new DOMPointReadOnly(50, 25);
const point3D = new DOMPointReadOnly(50, 0, 10);
const perspectivePoint3D = new DOMPointReadOnly(50, 50, 25, 0.5);
仕様書
Specification |
---|
Geometry Interfaces Module Level 1 # dom-dompointreadonly-dompointreadonly |
ブラウザーの互換性
BCD tables only load in the browser