You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Web Browser and version: Microsoft Edge Version 118.0.2088.61 (Official build) (64-bit)
Description
The editor uses (method) Phaser.Tilemaps.Tilemap.createLayer(layerID: string | number, tileset: string | Phaser.Tilemaps.Tileset | string[] | Phaser.Tilemaps.Tileset[], x?: number | undefined, y?: number | undefined): Phaser.Tilemaps.TilemapLayer | null to create TilemapLayer objects in generated code, which is recognized as a nullable value in TypeScript. When setting the object to class/public scope from editor, the null safety check would show compilation error because the field demands non-null value. Additionally, other features of this component, such as setting the Hit Area also demands non-null value, causing the same compilation error.
Possible solution
Maybe give the user an option to set (any) components to be not null. For example, in the inspector panel, under variable, add a checkbox "not null", and add ! to the end of the variable instantiation in the generated code when this checkbox is selected.
The text was updated successfully, but these errors were encountered:
Version
Description
The editor uses
(method) Phaser.Tilemaps.Tilemap.createLayer(layerID: string | number, tileset: string | Phaser.Tilemaps.Tileset | string[] | Phaser.Tilemaps.Tileset[], x?: number | undefined, y?: number | undefined): Phaser.Tilemaps.TilemapLayer | null
to create TilemapLayer objects in generated code, which is recognized as a nullable value in TypeScript. When setting the object to class/public scope from editor, the null safety check would show compilation error because the field demands non-null value. Additionally, other features of this component, such as setting the Hit Area also demands non-null value, causing the same compilation error.Possible solution
Maybe give the user an option to set (any) components to be not null. For example, in the inspector panel, under variable, add a checkbox "not null", and add
!
to the end of the variable instantiation in the generated code when this checkbox is selected.The text was updated successfully, but these errors were encountered: