main menu button hover callback

This commit is contained in:
arthur.jamet
2021-06-07 12:14:53 +02:00
parent d0d5935ae1
commit ea69116255
3 changed files with 58 additions and 13 deletions
+11 -1
View File
@@ -14,7 +14,8 @@ namespace RAY {
Image::Image(const std::string &filename):
Rectangle(Vector2(0, 0), Vector2(0, 0), WHITE),
_image(_imagesCache.fetch(filename))
_image(_imagesCache.fetch(filename)),
_ressourcePath(filename)
{
this->_dimensions = Vector2(this->_image->width, this->_image->height);
}
@@ -30,6 +31,15 @@ namespace RAY {
return *this->_image;
}
Image &Image::use(const std::string &filename)
{
if (this->_ressourcePath == filename)
return *this;
this->_image = this->_imagesCache.fetch(filename);
this->_ressourcePath = filename;
return *this;
}
Image::operator ::Image *()
{
return this->_image.get();