mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-30 01:05:24 +00:00
main menu button hover callback
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user