Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
It is invalid for TMXTiledMap to "setOpacity" and "setColor" #9162
it could be a minor bug I guess. I think Tiled allows you set the opacity of the maps (although I could be wrong). If so, then looks like a bug since users might expect to set the opacity programmatically as well.
But for sure this should not be fixed for v3.3rc1. All the tilemap fixes and improvements must be fixed for v3.4.
I'm still not seeing this feature in v3.4. Is it possible I'm using the API incorrectly?
The code below still shows 255 opacity:
I really need this feature, so I may see what I can do to add it.
I'm not really comfortable making a pull request for this because I feel that my approach is a bit of a hack. Here is the code, which I may create a pull request for, depending on what you guys think. I feel that there is a better way to do this.
I had issues iterating over the
I also found that doing it this way forces you to set the opacity much higher than it needs to be to achieve the desired effect. I'm assuming it's because the parent's opacity is adding to the child's opacity. For instance, I now have to set the opacity to ~170 to get about 80 opacity.
added a commit
Mar 4, 2015
There are still some issues, possibly related this, that our users are experiencing. From the U.S forums:
I have a TMXTiledMap and I’m trying to change its opacity but it won’t work.
auto mapBackground = TMXTiledMap::create(mapName+".tmx"); mapBackground->setOpacity(50); this->addChild(mapBackground);