Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Documentation of UISpriteElement.floating (and likely other inherited properties) incorrect #1237

Open
Waltibaba opened this issue Jul 3, 2024 · 1 comment
Labels

Comments

@Waltibaba
Copy link

Waltibaba commented Jul 3, 2024

Describe the bug

The new documentation says UISpriteElement.floating is default false, as inherited from Sprite.floating -> Renderable.floating: https://melonjs.github.io/melonJS/classes/UISpriteElement.html#floating .
Even though the UISpriteElement and other inherited classes change the floating property to default true and are correctly documented in jsdoc, e.g.

* 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;
the generated webdoc still says they are false by default. This caused me to pull out my hair for a few hours until I just looked it up in the source...

To Reproduce

  1. Implement a UISpriteElement
  2. Instantiate it and place it in a container (world or whichever you like that is movable)
  3. move that container (.translate(), .centerOn(), etc.)
  4. UISpriteElement stays at its instantiated screen coordinates instead of moving with the container coordinates.

Expected behavior

UISpriteElement should move with the container if, as the documentation says, floating=false.

Device (please complete the following information):

  • Device: Desktop PC
  • OS: Arch Linux (up to date 20240702)
  • Browser: all tested (Chromium, Firefox, Vanadium on Android)
  • melonJS Version: 17.3.0
@Waltibaba Waltibaba added the Bug label Jul 3, 2024
@obiot
Copy link
Member

obiot commented Jul 4, 2024

damn indeed ! So sorry for the lost hairs, and thanks for reporting it. We still have a few tweaks or this kind of unwanted behaviour from typedoc to fix since we moved away from webdoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants