#include "card.h" static Vector2 card_size = (Vector2) { CARD_WIDTH, CARD_HEIGHT }; static char *month_english_abbr[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; void draw_card(Card *c, Texture2D *cards_texture) { int i_vert = c->index % 4; int i_horiz = c->index / 4; int pos_vert = i_vert * 240; int pos_horiz = i_horiz * 146; DrawTexturePro( *cards_texture, (Rectangle) { pos_horiz, pos_vert, 146, 240 }, (Rectangle) { c->position.x, c->position.y, card_size.x, card_size.y }, (Vector2) { 0, 0 }, 0., RAYWHITE ); if (c->selected) { DrawCircle(c->position.x + 10, c->position.y + 10, 10, BLUE); } } bool point_within_card(Card *c, Vector2 point) { return point.x > c->position.x && point.x < c->position.x + card_size.x && point.y > c->position.y && point.y < c->position.y + card_size.y; }