| 56 | } |
| 57 | |
| 58 | void Grid::setTexture(Texture2D* var) { |
| 59 | _texture = var; |
| 60 | if (!_texture) return; |
| 61 | _texSize = Size{ |
| 62 | s_cast<float>(_texture->getWidth()), |
| 63 | s_cast<float>(_texture->getHeight())}; |
| 64 | if (_textureRect == Rect::zero) { |
| 65 | _textureRect.set(0, 0, s_cast<float>(var->getWidth()), s_cast<float>(var->getHeight())); |
| 66 | updateUV(); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | Texture2D* Grid::getTexture() const noexcept { |
| 71 | return _texture; |