Skip to content

Commit 04e4e07

Browse files
committed
More JSDocs
1 parent 860cdbf commit 04e4e07

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

src/gameobjects/domelement/DOMElement.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ var DOMElement = new Class({
237237
*
238238
* For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform
239239
*
240-
* @method Phaser.GameObjects.Sprite#setSkew
240+
* @method Phaser.GameObjects.DOMElement#setSkew
241241
* @since 3.17.0
242242
*
243243
* @param {number} [x=0] - The angle, in radians, by which to skew the DOM Element on the horizontal axis.
@@ -266,7 +266,7 @@ var DOMElement = new Class({
266266
*
267267
* **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.**
268268
*
269-
* @method Phaser.GameObjects.Sprite#setPerspective
269+
* @method Phaser.GameObjects.DOMElement#setPerspective
270270
* @since 3.17.0
271271
*
272272
* @param {number} value - The perspective value, in pixels, that determines the distance between the z plane and the user.
@@ -322,7 +322,7 @@ var DOMElement = new Class({
322322
* div.on('click', handler);
323323
* ```
324324
*
325-
* @method Phaser.GameObjects.Sprite#addListener
325+
* @method Phaser.GameObjects.DOMElement#addListener
326326
* @since 3.17.0
327327
*
328328
* @param {string} events - The DOM event/s to listen for. You can specify multiple events by separating them with spaces.
@@ -347,7 +347,7 @@ var DOMElement = new Class({
347347
/**
348348
* Removes one or more native DOM event listeners from the underlying Element of this Game Object.
349349
*
350-
* @method Phaser.GameObjects.Sprite#removeListener
350+
* @method Phaser.GameObjects.DOMElement#removeListener
351351
* @since 3.17.0
352352
*
353353
* @param {string} events - The DOM event/s to stop listening for. You can specify multiple events by separating them with spaces.
@@ -372,7 +372,7 @@ var DOMElement = new Class({
372372
/**
373373
* Internal event proxy to dispatch native DOM Events via this Game Object.
374374
*
375-
* @method Phaser.GameObjects.Sprite#dispatchNativeEvent
375+
* @method Phaser.GameObjects.DOMElement#dispatchNativeEvent
376376
* @private
377377
* @since 3.17.0
378378
*
@@ -384,31 +384,38 @@ var DOMElement = new Class({
384384
},
385385

386386
/**
387+
* Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object,
388+
* so you can control it. The `tagName` should be a string and is passed to `document.createElement`:
387389
*
390+
* ```javascript
391+
* this.add.dom().createElement('div');
392+
* ```
393+
*
394+
* For more details see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
388395
*
389-
* @method Phaser.GameObjects.Sprite#createElement
396+
* @method Phaser.GameObjects.DOMElement#createElement
390397
* @since 3.17.0
391398
*
392-
* @param {string} element -
393-
* @param {DOMString} style -
394-
* @param {DOMString} innerText -
399+
* @param {string} tagName - A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method.
400+
* @param {DOMString} [style] - A DOMString that holds the CSS styles to be applied to the created element.
401+
* @param {DOMString} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.
395402
*
396403
* @return {this} This DOM Element instance.
397404
*/
398-
createElement: function (element, style, innerText)
405+
createElement: function (tagName, style, innerText)
399406
{
400-
return this.setElement(document.createElement(element), style, innerText);
407+
return this.setElement(document.createElement(tagName), style, innerText);
401408
},
402409

403410
/**
404411
*
405412
*
406-
* @method Phaser.GameObjects.Sprite#setElement
413+
* @method Phaser.GameObjects.DOMElement#setElement
407414
* @since 3.17.0
408415
*
409416
* @param {(string|Element)} element -
410-
* @param {DOMString} style -
411-
* @param {DOMString} innerText -
417+
* @param {DOMString} [style] - A DOMString that holds the CSS styles to be applied to the created element.
418+
* @param {DOMString} [innerText] - A DOMString that holds the text that will be set as the innerText of the created element.
412419
*
413420
* @return {this} This DOM Element instance.
414421
*/

0 commit comments

Comments
 (0)