diff --git a/data/pal01.gif b/data/pal01.gif new file mode 100644 index 0000000..e24c6f4 Binary files /dev/null and b/data/pal01.gif differ diff --git a/data/pal02.gif b/data/pal02.gif new file mode 100644 index 0000000..aca1236 Binary files /dev/null and b/data/pal02.gif differ diff --git a/data/williams.gif b/data/williams.gif new file mode 100644 index 0000000..28334c0 Binary files /dev/null and b/data/williams.gif differ diff --git a/main.cpp b/main.cpp index d166288..9b76587 100644 --- a/main.cpp +++ b/main.cpp @@ -391,29 +391,32 @@ void checkEvents() break; case SDL_SCANCODE_F3: + ++fx %= fxTotal; + break; + + case SDL_SCANCODE_F4: --fireModifier; fireModifier = max(0, fireModifier); break; - case SDL_SCANCODE_F4: + case SDL_SCANCODE_F5: ++fireModifier; fireModifier = min(30, fireModifier); break; - case SDL_SCANCODE_SPACE: - ++fx %= fxTotal; - break; - - case SDL_SCANCODE_N: + case SDL_SCANCODE_F6: screen->showNotification("Ejemplo de notificacion", "con 2 lineas de texto", 0); break; - case SDL_SCANCODE_T: + case SDL_SCANCODE_F7: if (osk == nullptr) initOnScreenKeyboard(); else deleteOnScreenKeyboard(); break; + + case SDL_SCANCODE_F8: + break; default: break; @@ -628,19 +631,45 @@ void renderFX() // Dibuja el texto void renderText() { + const string text1 = "Jail Engine DEMO"; + const string text2 = "2023,2024 JailDesigner"; + + const string text3 = "Pulsa 'F1' o 'F2' para disminuir o aumentar la ventana"; + + const string text4 = "Pulsa 'F3' para cambiar el efecto de fondo: "; + const string text5 = "Pulsa 'F4' o 'F5' para modificar el efecto de fuego: "; + + const string text6 = "Pulsa 'F6' para mostrar una notificacion"; + const string text7 = "Pulsa 'F7' para mostrar u ocultar el teclado"; + const string text8 = "Pulsa 'F8' para aƱadir o eliminar sprites"; + + const string text9 = "Controles:"; + + const string text10 = "Pulsa 'ESCAPE' para terminar el programa"; const string fxName = fx == 0 ? "Degradado" : "Fuego"; + + const int center = options->screen.nativeWidth / 2; + text->setZoom(2); - text->writeDX(TXT_CENTER | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize(), "Jail Engine DEMO", 1, {255, 255, 255}, 1, {0, 0, 192}); + text->writeDX(TXT_CENTER | TXT_STROKE, center, text->getCharacterSize(), text1, 1, {255, 255, 255}, 1, {0, 0, 192}); text->disableZoom(); - text->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 4, "2023 JailDesigner", 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 7, "Pulsa 'F1' o 'F2' para disminuir o aumentar la ventana", 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 9, "Pulsa 'ESPACIO' para cambiar el efecto de fondo: " + fxName, 1, {240, 240, 240}, 1, {0, 0, 192}); + text->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 4, text2, 1, {240, 240, 240}, 1, {0, 0, 192}); + + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 7, text3, 1, {240, 240, 240}, 1, {0, 0, 192}); + + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 9, text4 + fxName, 1, {240, 240, 240}, 1, {0, 0, 192}); if (fxName == "Fuego") - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 11, "Pulsa 'F3' o 'F4' para modificar el fuego: " + to_string(fireModifier), 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 13, "Pulsa 'N' para mostrar una notificacion", 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 15, controllerName, 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, text->getCharacterSize() * 17, inputPressed, 1, {240, 240, 240}, 1, {0, 0, 192}); - debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, options->screen.nativeWidth / 2, options->screen.nativeHeight - (text->getCharacterSize() * 2), "Pulsa 'ESCAPE' para terminar el programa", 1, {240, 240, 240}, 1, {0, 0, 192}); + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 10, text5 + to_string(fireModifier), 1, {240, 240, 240}, 1, {0, 0, 192}); + + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 12, text6, 1, {240, 240, 240}, 1, {0, 0, 192}); + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 13, text7, 1, {240, 240, 240}, 1, {0, 0, 192}); + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 14, text8, 1, {240, 240, 240}, 1, {0, 0, 192}); + + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 16, text9, 1, {240, 240, 240}, 1, {0, 0, 192}); + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 17, controllerName, 1, {240, 240, 240}, 1, {0, 0, 192}); + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, text->getCharacterSize() * 18, inputPressed, 1, {240, 240, 240}, 1, {0, 0, 192}); + + debugText->writeDX(TXT_CENTER | TXT_COLOR | TXT_STROKE, center, options->screen.nativeHeight - (text->getCharacterSize() * 2), text10, 1, {240, 240, 240}, 1, {0, 0, 192}); } // Dibuja los elementos del programa en pantalla @@ -658,7 +687,7 @@ void render() // Dinuja el texto renderText(); - + // Dibuja el teclado en pantalla renderOnScreenKeyboard();