GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
common_ui.h File Reference

Common functions to render UI elements. More...

#include <stdbool.h>
#include <tonc.h>

Go to the source code of this file.

Macros

#define MAX_ACTIVE_JOKERS   8
 
#define MAX_HAND_SIZE   16
 
#define MAX_SELECTION_SIZE   5
 
#define MAX_BLIND_TOKEN   5
 
#define MAX_SKIP_TAGS   16
 

Enumerations

enum  SpritePaletteBanks {
  CARD_PB , DECK_PB , SKIP_TAGS_PB , NORMAL_BLIND_PB ,
  BOSS_BLIND_PB , JOKER_BASE_PB , JOKER_LAST_PB = 15 , NUM_PALETTES
}
 Indices of the palettes for the different type of sprites. More...
 
enum  BackgroundId {
  BG_NONE , BG_CARD_SELECTING , BG_CARD_PLAYING , BG_ROUND_END ,
  BG_SHOP , BG_BLIND_SELECT , BG_RUN_SETUP , BG_OPTIONS_MENU ,
  BG_MAIN_MENU
}
 Enum of possible backgrounds to render with change_background. More...
 

Functions

enum BackgroundId get_current_background (void)
 
void change_background (enum BackgroundId id, bool force_redraw)
 
void reset_top_left_panel_bottom_row (void)
 Restores the bottom row of the top-left panel from the background map.
 

Detailed Description

Common functions to render UI elements.

Definition in file common_ui.h.

Macro Definition Documentation

◆ MAX_ACTIVE_JOKERS

#define MAX_ACTIVE_JOKERS   8

Definition at line 29 of file common_ui.h.

◆ MAX_BLIND_TOKEN

#define MAX_BLIND_TOKEN   5

Definition at line 32 of file common_ui.h.

◆ MAX_HAND_SIZE

#define MAX_HAND_SIZE   16

Definition at line 30 of file common_ui.h.

◆ MAX_SELECTION_SIZE

#define MAX_SELECTION_SIZE   5

Definition at line 31 of file common_ui.h.

◆ MAX_SKIP_TAGS

#define MAX_SKIP_TAGS   16

Definition at line 33 of file common_ui.h.

Enumeration Type Documentation

◆ BackgroundId

Enum of possible backgrounds to render with change_background.

Definition at line 38 of file common_ui.h.

◆ SpritePaletteBanks

Indices of the palettes for the different type of sprites.

Definition at line 15 of file common_ui.h.

Function Documentation

◆ change_background()

void change_background ( enum BackgroundId  id,
bool  force_redraw 
)

Change the background

Parameters
idBackgroundId to render to screen

Definition at line 35 of file common_ui.c.

◆ get_current_background()

enum BackgroundId get_current_background ( void  )

Definition at line 30 of file common_ui.c.

◆ reset_top_left_panel_bottom_row()

void reset_top_left_panel_bottom_row ( void  )

Restores the bottom row of the top-left panel from the background map.

Definition at line 48 of file common_ui.c.