overlay amb outline
afegits credits dels ports
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Overlay {
|
||||
void init();
|
||||
void destroy();
|
||||
@@ -9,9 +12,31 @@ namespace Overlay {
|
||||
// Pinta l'overlay sobre el buffer ARGB — cridar abans de presentar
|
||||
void render(Uint32* pixel_data);
|
||||
|
||||
// Mostra una notificació amb animació slide-in/stay/slide-out
|
||||
// Posició + animació d'una notificació
|
||||
enum class NotifPosition {
|
||||
TOP_LEFT_SLIDE, // Cantó superior esquerra, slide horizontal des de fora
|
||||
TOP_CENTER_DROP, // Centrat horitzontal, baixa des de sobre
|
||||
};
|
||||
|
||||
// Estil de la notificació: caixa de fons, ombra o contorn del text
|
||||
enum class NotifStyle {
|
||||
BOX, // Rectangle de fons amb accent_color
|
||||
SHADOW, // Sense fons, text amb ombra (offset +1,+1) en accent_color
|
||||
OUTLINE, // Sense fons, text amb contorn 4-direccional en accent_color
|
||||
};
|
||||
|
||||
// Mostra una notificació amb animació slide-in/stay/slide-out (API simple)
|
||||
void showNotification(const char* text, float duration_seconds = 2.0F);
|
||||
|
||||
// Versió extensa: múltiples línies, posició, estil, colors i durada personalitzats.
|
||||
// accent_color s'usa com a fons (si style=BOX) o com a ombra (si style=SHADOW).
|
||||
void showNotification(const std::vector<std::string>& lines,
|
||||
float duration_seconds,
|
||||
NotifPosition pos,
|
||||
NotifStyle style,
|
||||
Uint32 accent_color,
|
||||
Uint32 text_color);
|
||||
|
||||
// Activa/desactiva la info de renderitzat (FPS, driver, shader, preset)
|
||||
void toggleRenderInfo();
|
||||
void cycleRenderInfo(int dir); // dir=+1 avant, -1 endarrere
|
||||
@@ -20,6 +45,11 @@ namespace Overlay {
|
||||
// `mono_mask` és un bitfield: bit N = 1 → segment N amb amplada monoespaiada.
|
||||
void setRenderInfoSegments(const char* s0, const char* s1, const char* s2, const char* s3, unsigned int mono_mask = 0);
|
||||
|
||||
// Crèdits seqüencials cinematogràfics (2 blocs fade-in/hold/fade-out)
|
||||
void startCredits();
|
||||
void cancelCredits();
|
||||
auto creditsActive() -> bool;
|
||||
|
||||
// Gestió d'eixida amb doble ESC
|
||||
// Retorna true si l'ESC ha sigut consumit (no s'ha de passar al joc)
|
||||
auto handleEscape() -> bool;
|
||||
|
||||
Reference in New Issue
Block a user