phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.95k stars 7.08k forks source link

Inconsistency between the documentation and the name of parameters for the Config.js file #6875

Closed IvGaLa closed 1 month ago

IvGaLa commented 1 month ago

Version

Description

Hello, according to the documentation to hide the information banner with the version it is necessary to use the "hideBanner" variable for the config (https://newdocs.phaser.io/docs/3.80.0/Phaser.Core.Config#hideBanner) but with that name it doesn't work.

As can be seen in the "Config.js" file (https://github.com/phaserjs/phaser/blob/v3.80.1/src/core/Config.js) "banner" is expected as the parameter name instead from "hideBanner".

Setting the variable in the config to "banner: false" does not display the banner with the Phaser name and version.

I leave an example in the following links: Not working: https://jsfiddle.net/IvGaLa/6gLbfzhj/8 It works: https://jsfiddle.net/IvGaLa/6gLbfzhj/9

Additionally, for the "hidePhaser" variable in the documentation it is also incorrect in the Config.js file, since it is expected as the name of the parameter "banner.hidePhaser".

Thanks greetings.

Example Test Code

Not working: https://jsfiddle.net/IvGaLa/6gLbfzhj/8 8

It works: https://jsfiddle.net/IvGaLa/6gLbfzhj/9 9

Additional Information

I consider that the Config.js file is incorrect in expecting those parameter names and different ones are indicated in the configuration.

greptile-apps[bot] commented 1 month ago

For internal use only

To resolve the inconsistency between the documentation and the parameter names in Config.js, update the documentation to reflect the correct parameter names used in the code.

  1. Update Documentation:

    • Change hideBanner to banner.
    • Change hidePhaser to banner.hidePhaser.
  2. Code Reference:

    • Config.js expects banner and banner.hidePhaser as parameter names:
      this.hideBanner = (GetValue(config, 'banner', null) === false);
      this.hidePhaser = GetValue(config, 'banner.hidePhaser', false);
  3. Documentation Update:

References

/src/core/typedefs/BannerConfig.js /.github/ISSUE_TEMPLATE/bug_report.md /.github/ISSUE_TEMPLATE /changelog/3.23 /types/phaser.d.ts /changelog/3.7.1/CHANGELOG-v3.7.1.md /changelog/3.16.2/CHANGELOG-v3.16.2.md /config /changelog/3.1.1 /.github/CONTRIBUTING.md /.github /changelog/3.54 /changelog/3.15 /changelog/3.17/CHANGELOG-v3.17.md /src/gameobjects/shader/typedefs/ShaderConfig.js /changelog/3.23/CHANGELOG-v3.23.md /changelog/3.80/CHANGELOG-v3.80.md /changelog/3.16.2 /changelog/3.1.2/CHANGELOG-v3.1.2.md /changelog/3.18/CHANGELOG-v3.18.md /.github/ISSUE_TEMPLATE/feature_request.md /changelog/3.7.1 /config/webpack.config.js /config/webpack-nospector.config.js /src/core/Config.js

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/phaserjs/phaser/master) · [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
photonstorm commented 1 month ago

The config file is correct - it doesn't say it expects hideBanner to exist in the config. It's just an internal property within that class.

If you look at the typedef for the object that you should give to the Game instance: https://newdocs.phaser.io/docs/3.80.0/Phaser.Types.Core.GameConfig then you can see the properties this object should contain. banner links to https://newdocs.phaser.io/docs/3.80.0/Phaser.Types.Core.BannerConfig - or it can be a boolean (false) to disable the banner entirely.