- [NEW] getLocalX() i getLocalY(), per a obtindre les coordenades del ratolí en l'espai del viewport

This commit is contained in:
2023-10-06 18:54:22 +02:00
parent d185c4f20b
commit 35df2fe8db
2 changed files with 13 additions and 0 deletions

View File

@@ -187,6 +187,16 @@ namespace draw
viewport.h = destination->h;
}
const int getLocalX(const int x)
{
return x - viewport.x;
}
const int getLocalY(const int y)
{
return y - viewport.y;
}
// Estableix la paleta del sistema carregant-la d'un GIF
void loadPalette(const std::string &filename)
{

View File

@@ -61,6 +61,9 @@ namespace draw
void setViewport(const int x, const int y, const int w, const int h);
void resetViewport();
const int getLocalX(const int x);
const int getLocalY(const int y);
/// @brief Estableix la paleta del sistema carregant-la d'un GIF
/// @param filename nom de l'arxiu GIF d'on carregar la paleta
void loadPalette(const std::string &filename);