Is there a way to get the pixel color for a position in a tile of a TMXTiledMap ?
Get pixel color for tile in tmxtiledmap?
(5 posts) (4 voices)-
Posted 2 years ago #
-
Byte pixelColor[4];
glReadPixels(x,y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixelColor[0]);I'm in the process of writing a general color picker node to submit to the cocos library, but if you know OpenGL you can just use this.
Posted 2 years ago # -
Thanks, but isn't this only for the pixel at that position in the framebuffer, as it doesn't work for me.
Posted 2 years ago # -
Also looking for this, anyone know how to read the pixel color at a location on a tile from a TMX map?
Posted 10 months ago # -
You could get the sprite of the tile, load it into a mutable texture and read out the color value.
Posted 9 months ago #
Reply
You must log in to post.