| 258 | } |
| 259 | |
| 260 | bool Sprite::initWithPolygon(const ax::PolygonInfo& info) |
| 261 | { |
| 262 | bool ret = false; |
| 263 | |
| 264 | Texture2D* texture = _director->getTextureCache()->addImage(info.getFilename()); |
| 265 | if (texture && initWithTexture(texture)) |
| 266 | { |
| 267 | _polyInfo = info; |
| 268 | _renderMode = RenderMode::POLYGON; |
| 269 | Node::setContentSize(_polyInfo.getRect().size / _director->getContentScaleFactor()); |
| 270 | ret = true; |
| 271 | } |
| 272 | |
| 273 | return ret; |
| 274 | } |
| 275 | |
| 276 | // designated initializer |
| 277 | bool Sprite::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated) |
no test coverage detected