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

Don't create new canvases for TMX Tile Objects. #595

Closed
parasyte opened this issue Oct 22, 2014 · 4 comments
Closed

Don't create new canvases for TMX Tile Objects. #595

parasyte opened this issue Oct 22, 2014 · 4 comments
Milestone

Comments

@parasyte
Copy link
Collaborator

While debugging some changes in the WebGL Renderer, I found that the Tile Objects used in the platformer (the spikes) each have their own canvas object. This makes caching difficult, and will break the batching logic (#591), because none of them share a texture.

The code that creates the canvas is me.TMXTileset.getTileImage:

getTileImage : function (tmxTile) {
It is called by the TMXObjectGroup class, when the object has a gid property:
this.setImage(this.gid, tilesets);

@parasyte parasyte added this to the 1.3.0 milestone Oct 22, 2014
@obiot
Copy link
Member

obiot commented Oct 22, 2014

what should we create then ? and entity with a body and a renderable component ?

@parasyte
Copy link
Collaborator Author

It would need the Texture Atlas work that I mentioned in #591, but then this one could just change from creating a new canvas to instead referencing the original texture and an atlas index.

@parasyte
Copy link
Collaborator Author

#591 depends on this bug getting fixed.

Uncaught me.video.Error: Texture cache overflow: 16 texture units available.

Throws the exception after reloading the maps in the platformer example a few times.

parasyte referenced this issue Jan 19, 2015
…spritesheet

some redundant code to be removed later.
@parasyte
Copy link
Collaborator Author

parasyte commented Feb 7, 2015

This one was fixed by #592

@parasyte parasyte closed this as completed Feb 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants