Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions packages/melonjs/src/renderable/ui/uibaseelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ import Container from "../container.js";
export default class UIBaseElement extends Container {
#boundPointerMoveHandler;

/**
* UI base elements use screen coordinates by default
* (Note: any child elements added to a UIBaseElement should have their floating property to false)
* @see Renderable.floating
* @type {boolean}
* @default true
*/
floating = true;

/**
*
* @param {number} x - The x position of the container
Expand Down Expand Up @@ -65,15 +74,6 @@ export default class UIBaseElement extends Container {
*/
this.released = true;

/**
* UI base elements use screen coordinates by default
* (Note: any child elements added to a UIBaseElement should have their floating property to false)
* @see Renderable.floating
* @type {boolean}
* @default true
*/
this.floating = true;

// object has been updated (clicked,etc..)
this.holdTimeout = -1;

Expand Down
18 changes: 9 additions & 9 deletions packages/melonjs/src/renderable/ui/uispriteelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import Sprite from "./../sprite.js";
* This is a basic sprite based button which you can use in your Game UI.
*/
export default class UISpriteElement extends Sprite {
/**
* if this UISpriteElement should use screen coordinates or local coordinates
* (Note: any UISpriteElement elements added to a floating parent container should have their floating property to false)
* @see Renderable.floating
* @type {boolean}
* @default true
*/
floating = true;

/**
* @param {number} x - the x coordinate of the UISpriteElement Object
* @param {number} y - the y coordinate of the UISpriteElement Object
Expand Down Expand Up @@ -73,15 +82,6 @@ export default class UISpriteElement extends Sprite {
this.holdTimeout = -1;
this.released = true;

/**
* if this UISpriteElement should use screen coordinates or local coordinates
* (Note: any UISpriteElement elements added to a floating parent container should have their floating property to false)
* @see Renderable.floating
* @type {boolean}
* @default true
*/
this.floating = true;

// enable event detection
this.isKinematic = false;
}
Expand Down