diff --git a/Docs/[ENG] User manual/ngn_camera [ENG].txt b/Docs/[ENG] User manual/ngn_camera [ENG].txt index 6229b10..e928e62 100644 --- a/Docs/[ENG] User manual/ngn_camera [ENG].txt +++ b/Docs/[ENG] User manual/ngn_camera [ENG].txt @@ -1,5 +1,5 @@ NGN_CAMERA.H -v1.16.0-stable +v1.17.0-stable English -------------------------------------------------------------------------------- @@ -195,34 +195,82 @@ ngn->camera->Reset(); -------------------------------------------------------------------------------- +- Method +bool CheckIfRegistered(NGN_Sprite* sprite); +bool CheckIfRegistered(NGN_Texture* texture); + +- Description +Determines if a sprite or a texture is currently registered and managed by the 2D camera. + +- Example +bool i = ngn->camera->CheckIfRegistered(bullet->sprite); + +-------------------------------------------------------------------------------- + +- Method +Vector2 GetLookAt(); + +- Description +Returns a Vector2 representing the position the camera is currently looking at in the world. + +- Example +Vector2 look = ngn->camera->GetLookAt(); + +-------------------------------------------------------------------------------- + +- Method +Size2I32 GetRendererSize(); + +- Description +Returns a Size2I32 variable with the current size of the camera's rendering area. + +- Example +Size2I32 renderer_area = ngn->camera->GetRendererSize(); + +-------------------------------------------------------------------------------- + +- Method +void Shake(float intensity, float frequency, bool split = true); + +- Description +Creates a vertical shaking effect in the camera's scene. +The "intensity" parameter specifies the magnitude of the effect in pixels. +The "frequency" parameter specifies the speed of the effect (in radians per second). +The "split" parameter determines whether the effect is applied separately to the different layers of the scene. + +- Example +ngn->camera->Shake(3.0f, 0.2f, false); + +-------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- - PROPIEDADES de la clase + PROPERTIES of the class -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Propiedad +- Property Size2I world - Description -Almacena el tamaño actual del mundo. +Stores the current size of the world. -------------------------------------------------------------------------------- -- Propiedad +- Property Vector2I position - Description -Almacena la posición actual de la cámara en el mundo. +Stores the current position of the camera in the world. -------------------------------------------------------------------------------- -- Propiedad +- Property bool animation_pause - Description -Pausa la animación de todos los sprites si su valor es TRUE. +Pauses the animation of all sprites if its value is TRUE. -------------------------------------------------------------------------------- diff --git a/Docs/[ENG] User manual/ngn_resources [ENG].txt b/Docs/[ENG] User manual/ngn_resources [ENG].txt index 06155a3..fafd24a 100644 --- a/Docs/[ENG] User manual/ngn_resources [ENG].txt +++ b/Docs/[ENG] User manual/ngn_resources [ENG].txt @@ -1,5 +1,5 @@ NGN_RESOURCES.H -v1.16.0-stable +v1.17.0-stable English -------------------------------------------------------------------------------- @@ -111,16 +111,16 @@ if (!ngn->resources->Load("local", "data/resources.txt")) return false; -------------------------------------------------------------------------------- - Method -NGN_TextureData* GetTexture(std::string repo_name, std::string resource_name); -NGN_TiledBgData* GetTiledbg(std::string repo_name, std::string resource_name); -NGN_SpriteData* GetSprite(std::string repo_name, std::string resource_name); -NGN_CollisionMapData* GetCmap(std::string repo_name, std::string resource_name); -NGN_AudioClipData* GetSfx(std::string repo_name, std::string resource_name); -std::vector GetTxt(std::string repo_name, std::string resource_name); -NGN_TextFont* GetTypeface(std::string repo_name, std::string resource_name); +NGN_TextureData* GetTexture(std::string repo_name, std::string resource_name, bool err = true); +NGN_TiledBgData* GetTiledbg(std::string repo_name, std::string resource_name, bool err = true); +NGN_SpriteData* GetSprite(std::string repo_name, std::string resource_name, bool err = true); +NGN_CollisionMapData* GetCmap(std::string repo_name, std::string resource_name, bool err = true); +NGN_AudioClipData* GetSfx(std::string repo_name, std::string resource_name, bool err = true); +std::vector GetTxt(std::string repo_name, std::string resource_name, bool err = true); +NGN_TextFont* GetTypeface(std::string repo_name, std::string resource_name, bool err = true); - Description -Returns a memory pointer to the resource with the requested name or a vector with the content in the case of text files. If the resource or the repository is not found, it returns NULL or an empty vector. +Returns the memory pointer to the resource with the requested name or a vector with the content in the case of text files. If the resource or repository is not found, it returns NULL or an empty vector. If the "err" parameter is TRUE (by default), it also prints the error in the debug console and in the log file if the resource is not found. - Example NGN_Texture* bg = new NGN_Texture(ngn->resources->GetTexture(“local”, “background”), 0, 0); diff --git a/Docs/[ESP] Manual del usuario/ngn_camera [ESP].txt b/Docs/[ESP] Manual del usuario/ngn_camera [ESP].txt index 86d018f..eeb1ab1 100644 --- a/Docs/[ESP] Manual del usuario/ngn_camera [ESP].txt +++ b/Docs/[ESP] Manual del usuario/ngn_camera [ESP].txt @@ -1,5 +1,5 @@ NGN_CAMERA.H -v1.16.0-stable +v1.17.0-stable Español -------------------------------------------------------------------------------- @@ -194,6 +194,54 @@ ngn->camera->Reset(); -------------------------------------------------------------------------------- +- Método +bool CheckIfRegistered(NGN_Sprite* sprite); +bool CheckIfRegistered(NGN_Texture* texture); + +- Descripción +Determina si un sprite o una textura están actualmente registrados y gestionados por la cámara 2D. + +- Ejemplo +bool i = ngn->camera->CheckIfRegistered(bullet->sprite); + +-------------------------------------------------------------------------------- + +- Método +Vector2 GetLookAt(); + +- Descripción +Devuelve un Vector2 con la posición a la que está mirando actualmente la cámara en el mundo. + +- Ejemplo +Vector2 look = ngn->camera->GetLookAt(); + +-------------------------------------------------------------------------------- + +- Método +Size2I32 GetRendererSize(); + +- Descripción +Devuelve una variable Size2I32 con el tamaño actual del área de renderizado de la cámara. + +- Ejemplo +Size2I32 renderer_area = ngn->camera->GetRendererSize(); + +-------------------------------------------------------------------------------- + +- Método +void Shake(float intensity, float frequency, bool split = true); + +- Descripción +Genera un efecto de temblor vertical en la escena de la cámara. +El parámetro "intensity" especifica la magnitud del efecto en píxeles. +El parámetro "frequency" especifica la velocidad del efecto (en radianes por segundo). +El parámetro "split" determina si el efecto se aplica por separado a las diferentes capas de la escena. + +- Ejemplo +ngn->camera->Shake(3.0f, 0.2f, false); + +-------------------------------------------------------------------------------- + -------------------------------------------------------------------------------- diff --git a/Docs/[ESP] Manual del usuario/ngn_resources [ESP].txt b/Docs/[ESP] Manual del usuario/ngn_resources [ESP].txt index daf1625..585a3d0 100644 --- a/Docs/[ESP] Manual del usuario/ngn_resources [ESP].txt +++ b/Docs/[ESP] Manual del usuario/ngn_resources [ESP].txt @@ -1,5 +1,5 @@ NGN_RESOURCES.H -v1.16.0-stable +v1.17.0-stable Español -------------------------------------------------------------------------------- @@ -109,16 +109,16 @@ if (!ngn->resources->Load("local", "data/resources.txt")) return false; -------------------------------------------------------------------------------- - Métodos -NGN_TextureData* GetTexture(std::string repo_name, std::string resource_name); -NGN_TiledBgData* GetTiledbg(std::string repo_name, std::string resource_name); -NGN_SpriteData* GetSprite(std::string repo_name, std::string resource_name); -NGN_CollisionMapData* GetCmap(std::string repo_name, std::string resource_name); -NGN_AudioClipData* GetSfx(std::string repo_name, std::string resource_name); -std::vector GetTxt(std::string repo_name, std::string resource_name); -NGN_TextFont* GetTypeface(std::string repo_name, std::string resource_name); +NGN_TextureData* GetTexture(std::string repo_name, std::string resource_name, bool err = true); +NGN_TiledBgData* GetTiledbg(std::string repo_name, std::string resource_name, bool err = true); +NGN_SpriteData* GetSprite(std::string repo_name, std::string resource_name, bool err = true); +NGN_CollisionMapData* GetCmap(std::string repo_name, std::string resource_name, bool err = true); +NGN_AudioClipData* GetSfx(std::string repo_name, std::string resource_name, bool err = true); +std::vector GetTxt(std::string repo_name, std::string resource_name, bool err = true); +NGN_TextFont* GetTypeface(std::string repo_name, std::string resource_name, bool err = true); - Descripción -Devuelve el puntero de memoria al recurso con el nombre solicitado, o un vector con el contenido en el caso de los archivos de texto. Si el recurso o el repositorio no se encuentran, devuelve NULL o un vector vacío. +Devuelve el puntero de memoria al recurso con el nombre solicitado, o un vector con el contenido en el caso de los archivos de texto. Si el recurso o el repositorio no se encuentran, devuelve NULL o un vector vacío. Si el parámetro "err" está en TRUE (por defecto), además imprime en la consola de depuración y en el archivo de registro el error en caso de no encontrar el recurso. - Ejemplo NGN_Texture* bg = new NGN_Texture(ngn->resources->GetTexture(“local”, “background”), 0, 0); diff --git a/Docs/changelog [ENG].txt b/Docs/changelog [ENG].txt index 2ba970e..ae714b0 100644 --- a/Docs/changelog [ENG].txt +++ b/Docs/changelog [ENG].txt @@ -1,3 +1,19 @@ +-------------------------------------------------------------------------------- +2024-07-29 Ver.1.17.0-stable +-------------------------------------------------------------------------------- +- The "err" parameter has been added to the resource loading methods of the "NGN_Resources" class, allowing you to choose whether to display and log the error if the resource cannot be found. +- The installation scripts for the library have been updated for Linux and Raspberry Pi OS environments. +- A minor optimisation has been made to the key/button reading in the NGN_Input class. +- A bug has been fixed in the NGN_Camera class, which prevented virtual backgrounds from being correctly enabled when using textures. +- The update algorithm in the NGN_Camera class has been optimised. +- The CheckIfRegistered() method has been added to the NGN_Camera class, which checks if a sprite is currently registered with the camera. +- The GetLookAt() method has been added to the NGN_Camera class, which returns the point the camera is looking at in the world. +- The GetRendererSize() method has been added to the NGN_Camera class, which returns the size of the camera’s renderer. +- The Shake() method has been added to the NGN_Camera class, which creates a shaking effect in the scene. +- In the templates, scripts have been added for dependency searching in Linux and Raspberry Pi OS environments. +- On Windows, the library has been rebuilt using SDL2 2.30.5, SDL_TTF 2.22.0, and LodePNG 20230410 versions. + + -------------------------------------------------------------------------------- 2024-03-16 Ver.1.16.0-Stable -------------------------------------------------------------------------------- diff --git a/Docs/changelog [ESP].txt b/Docs/changelog [ESP].txt index bea4a6b..12961c8 100644 --- a/Docs/changelog [ESP].txt +++ b/Docs/changelog [ESP].txt @@ -1,3 +1,19 @@ +-------------------------------------------------------------------------------- +2024-07-29 Ver.1.17.0-stable +-------------------------------------------------------------------------------- +- Se ha añadido el parámetro "err" a los métodos de carga de recursos de la clase "NGN_Resources", el cual permite escoger si mostrar y registrar el error en caso de que el recurso no se encuentre. +- Se han actualizado los scripts de instalación de la librería para los entornos Linux y Raspberry Pi OS. +- Se ha realizado una optimización menor en la lectura de teclas/botones de la clase NGN_Input. +- Se ha corregido un error en la clase NGN_Camera, que impedía habilitar correctamente los fondos virtuales cuando se usaban texturas. +- Se ha optimizado el algoritmo de actualización de la clase NGN_Camera. +- Se ha añadido el método CheckIfRegistered() en la clase NGN_Camera, el cual verifica si un sprite está registrado actualmente en la cámara. +- Se ha añadido el método GetLookAt() en la clase NGN_Camera, el cual devuelve el punto al que está mirando la cámara en el mundo. +- Se ha añadido el método GetRendererSize() en la clase NGN_Camera, el cual devuelve el tamaño del renderizador de la cámara. +- Se ha añadido el método Shake() en la clase NGN_Camera, el cual crea un efecto de temblor en la escena. +- En los templates, se han añadido scripts para la búsqueda de dependencias en los entornos Linux y Raspberry Pi OS. +- En Windows, se ha actualizado la compilación de la librería usando las versiones SDL2 2.30.5, SDL_TTF 2.22.0 y LodePNG 20230410. + + -------------------------------------------------------------------------------- 2024-03-16 Ver.1.16.0-estable -------------------------------------------------------------------------------- diff --git a/Examples/01_texture_loading/Texture_Loading.cbp b/Examples/01_texture_loading/Texture_Loading.cbp index b2b549e..3b0f468 100644 --- a/Examples/01_texture_loading/Texture_Loading.cbp +++ b/Examples/01_texture_loading/Texture_Loading.cbp @@ -127,9 +127,8 @@