예제 #1
0
static void draw_item_cost(GameState* gs, const BBox& bbox, int cost) {
	PlayerInst* player = gs->local_player();
	Colour col = COL_PALE_GREEN;
	if (player->gold() < cost) {
		col = COL_PALE_RED;
	}
	gl_printf_centered(gs->primary_font(), col, bbox.center_x(),
			bbox.y1 - TILE_SIZE / 2, "Cost: %dg", cost);
}
예제 #2
0
static BBox icon_bounds(const BBox& main_content_bounds, int icon_n,
		int total_n, int row = 0) {
	int icon_sep = TILE_SIZE + 2;
	int icon_sx = main_content_bounds.center_x() - icon_sep * total_n / 2;
	int icon_sy = main_content_bounds.y2 + (row + 1) * (TILE_SIZE + 2);

	int icon_x = icon_sx + icon_n * icon_sep;

	return BBox(icon_x, icon_sy, icon_x + TILE_SIZE, icon_sy + TILE_SIZE);
}