question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect position values passed to super call in derived class of nested prefab

See original GitHub issue
  • Phaser Editor 2D Version: v3.30.0
  • Operating System: Mac

Description

After creating a derived class from a generic nested prefab class, the super call has the wrong arguments passed for the position

ScaledTextBox.ts

export default class ScaledTextBox extends Phaser.GameObjects.Container {

    constructor(scene: Phaser.Scene, x?: number, y?: number) {
        super(scene, x ?? 0, y ?? 0);

SpeechLowerRightScaledTextBox.ts

export default class SpeechLowerRightScaledTextBox extends ScaledTextBox {

    constructor(scene: Phaser.Scene, x?: number, y?: number) {
        super(scene, x, x);

Notice that instead of passing x, y, x, x is passed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PhaserEditor2Dcommented, Oct 26, 2021

I think this is solved. If you experience the issue again please re-open this.

1reaction
PhaserEditor2Dcommented, Oct 22, 2021

Done! Solved in develop.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the difference between nested prefabs ... - Unity Forum
Say you have a Prefab called 'A': If Prefab 'A' contains another Prefab as a child GameObject, we call that a nested Prefab....
Read more >
java - Why do this() and super() have to be the first statement ...
So basically construct an object based on constructor parameters, store the object in a member, and also pass the result of a method...
Read more >
Prefab Variants - Unity - Manual
A Prefab Variant inherits the properties of another Prefab, called the base. Overrides made to the Prefab Variant take precedent over the base...
Read more >
Phaser Editor 2D v3.31.0 released. | HTML5 games IDE
#154 Incorrect position values passed to super call in a derived class of nested prefab. Scene editor: fixes Break Parent command.
Read more >
PhaserEditor2D-v3/CHANGELOG.MD at master - GitHub
#154 Incorrect position values passed to super call in derived class of nested prefab. 150 Incorrect editor representation: Unlocked nested prefab ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found