Esempio n. 1
0
void
init_setting(unsigned int x, unsigned int y)
{
	int i, j;
	int offset_x, offset_y;
	x += 1;
	y += 20;
	for(i = 0; i < WindowWidth - 2; ++i)
	{
		for(j = 0; j < WindowHeight - 40; ++j)
		{
			draw_point(x + i, y + j, 0xFFFF);
		}
	}
	for(i = 0; i < 5; i++)
	{	
		offset_x = 30 * (i % 3 + 1) + 160 * (i % 3);
		offset_y = 30 * (i / 3 + 1) + 120 * (i / 3);
		draw_thumbnail(x + offset_x, y + offset_y, i);
	}
}
void draw_minion_avaliable(SDL_Renderer *renderer, list_minion_avaliable *list, int per_row, int position[]) {
    list_minion_avaliable *temp = list;
    int x_init, y_init;
    int line = 0;

    x_init =  position[0];
    y_init = position[1];

    while(temp != NULL && temp->e != NULL) {
        draw_thumbnail(renderer, temp->e->thumbnail, x_init, y_init);
        line++;
        temp = temp->next;
        if(line == per_row) {
            x_init = position[0];
            y_init += MENU_ICON;
            line = 0;
        }
        else {
            x_init += MENU_ICON;
        }
    }
}