Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Barrelrolla opened this issue Apr 28, 2017 · 5 comments
Labels

Comments

@Barrelrolla
Copy link

  • 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);
@AleBles AleBles added the bug label May 1, 2017
@fmflame
Copy link

fmflame commented May 5, 2017

Hey, what's up with this bug? Any status update - is it hard to fix? I would really love to use it!

@AleBles
Copy link
Member

AleBles commented May 8, 2017

I'm not seeing this happen when I duplicate the button in the example, which version of Phaser are you guys on?

edit; NVM, just found out it happens on Phaser-CE

@AleBles
Copy link
Member

AleBles commented Jun 2, 2017

Also found out it's a bug in Phaser-ce: http://www.html5gamedevs.com/topic/27041-gldrawelements-source-and-destination-textures-of-the-draw-are-the-same/#comment-165755

So either you downgrade to Phaser 2.6.2, or we rewrite this lib to not user RenderTexture.

@fmflame
Copy link

fmflame commented Jun 2, 2017

Well If it's really a Phaser-ce bug, then this should get fixed at some point and your lib would work right? My point being that if that is the case I can go vote for this issue on Phaser-ce github and possibly try to fix it at some point when I find the time?

@AleBles
Copy link
Member

AleBles commented Jun 6, 2017

No bug reported in the phaser-ce repo yet, I'll be sure to make one later today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants