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.

Tint values are set when prefab is used in scene even though they aren't overridden

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

Description

I have a button prefab that extends a text box prefab and overrides the tint values. If I use this button prefab in a scene, the generated code in the scene is also setting the tint values even though they are not overridden.

Note that the margins and textures are also overridden but those values aren’t repeated. Just seems to be the tint?

Button.ts

export default class Button extends ScaledTextBox {

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

        this.ninepatch.setTexture("button");
        this.ninepatch.tintTopLeft = 16742575;
        this.ninepatch.tintTopRight = 16742575;
        this.ninepatch.tintBottomLeft = 16742575;
        this.ninepatch.tintBottomRight = 16742575;
        this.ninepatch.ninePatchWidth = 472;
        this.ninepatch.ninePatchHeight = 241;
        this.ninepatch.marginLeft = 32;
        this.ninepatch.marginTop = 36;
        this.ninepatch.marginRight = 34;
        this.ninepatch.marginBottom = 36;
        this.defaultText.setPosition(29, 68);
        this.defaultText.setStyle({"fontSize":"96px"});

Splash.ts

        // letGoButton
        const letGoButton = new Button(this, 530, 573);
        this.add.existing(letGoButton);
        letGoButton.defaultText.tintTopLeft = 16742575;
        letGoButton.defaultText.tintTopRight = 16742575;
        letGoButton.defaultText.tintBottomLeft = 16742575;
        letGoButton.defaultText.tintBottomRight = 16742575;
        letGoButton.defaultText.setPosition(61, 57);
        letGoButton.defaultText.text = "Let's Go!";
        letGoButton.defaultText.setStyle({"fontSize":"120px"});

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
PhaserEditor2Dcommented, Oct 26, 2021

Hi!

Thanks for the detailed description. I will take a look.

1reaction
PhaserEditor2Dcommented, Oct 26, 2021

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prefab doesn't save script properties values, override doesn't ...
I have a game object that has a script. the prefab created after ... in the scene that are not part of the...
Read more >
Instance overrides - Unity - Manual
An overridden property value on a Prefab instance always takes precedence over the value from the Prefab Asset. This means that if you...
Read more >
Why won't this prefab override stay overriden?Can anyone ...
When you select Overrides > Apply All, the blue lines should disappear because it will apply those overrides to the prefab itself.
Read more >
How to use Sorting Layers in Unity - Game Dev Beginner
Learn how to sort 2D & 3D objects in Unity, using Sorting Layers, Sorting Groups and camera rendering tricks.
Read more >
Lighting & rendering tutorial for HDRP | Unite Now 2020
In this video, you'll learn how to create AAA-quality visuals for current and next-gen games. We 'll also show you HDRP's key rendering ......
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