Skip to content

Trying to add two instances of PhaserNineSlice.NineSlice causes a webGL error and doesn't show the second instance. #5

@Barrelrolla

Description

@Barrelrolla
  • A bug in the API (always say which version you're using!)
    Version: "@orange-games/phaser-nineslice": "^2.0.0",

Trying to add two instances with a texture from the same atlas causes a WebGL error:
[.Offscreen-For-WebGL-07472F00]GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.
The result is that the second instance doesn't show up.

The code that causes the error:

	this.nineSlice = new PhaserNineSlice.NineSlice(
		this.game as PhaserNineSlice.NineSliceGame,
		400,
		100,
		AssetsKeys.ATLAS_GAME_VIEW,
		AssetsKeys.ATLAS_GAME_VIEW_KEYS.MY_CARDS_VIEW.BOOKS_REVIEWER_BACK_BTN_UP,
		500,
		200,
		{
			top: 20,
			bottom: 20,
			left: 50,
			right: 50
		}
	);
	this.game.add.existing(this.nineSlice);

	this.nineSlice2 = new PhaserNineSlice.NineSlice(
		this.game as PhaserNineSlice.NineSliceGame,
		0,
		0,
		AssetsKeys.ATLAS_GAME_VIEW,
		AssetsKeys.ATLAS_GAME_VIEW_KEYS.MY_CARDS_VIEW.BOOKS_REVIEWER_BACK_BTN_UP,
		200,
		500,
		{
			top: 20,
			bottom: 20,
			left: 50,
			right: 50
		}
	);
	this.game.add.existing(this.nineSlice2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions