GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
NinePatchRect Struct Reference

Structure to represent arbitrary-sized 9-patches. More...

#include <graphic_utils.h>

Data Fields

Rect patch_rect
 
Rect margins
 

Detailed Description

Structure to represent arbitrary-sized 9-patches.

While expanding a 3x3 rect is simple enough and has its purpose, this is an attempt to generalize the idea to a struct representing a 9-patch like this, such that areas 1, 2, 3 and 4 have no null dimensions and don't overlap:

margins.left margins.right │ Such as:
╭───┴───╮ ╭─┴─╮ │
╔═══════╤═════╤═══╗ ╮ │ 1) margins.left + margins.right <= width (patch_rect)
║ 1 │ 6 │ 2 ║ ├─ margins.top │
╟───────┼─────┼───╢ ╯ │ 2) margins.top + margins.bottom <= height(patch_rect)
║ 5 │ 0 │ 7 ║ │
║ │ │ ║ │ 3) margins values are inclusive, in number of tiles
╟───────┼─────┼───╢ ╮ │
║ │ │ ║ │ │
║ 4 │ 8 │ 3 ║ ├─ margins.bottom │
║ │ │ ║ │ │
╚═══════╧═════╧═══╝ ╯ │
╰────────┬────────╯ │
patch_rect │

Definition at line 260 of file graphic_utils.h.

Field Documentation

◆ margins

Rect margins

Definition at line 263 of file graphic_utils.h.

◆ patch_rect

Rect patch_rect

Definition at line 262 of file graphic_utils.h.


The documentation for this struct was generated from the following file: