front_single = LoadTextureFromImage(img);
UnloadImage(img);
img = LoadImage("aichan-front-sheet.png");
- struct spritesheet front_sheet = {img, 15, 18, 13};
+ front_sheet.img = img; front_sheet.width_each = 15; front_sheet.height_each = 18; front_sheet.columns=13;
UnloadImage(img);
sheets[0] = &front_sheet;
txtr = LoadTextureFromImage(front_sheet.img);
time_since_switch += delta_player;
if (time_since_switch >= FRAMELENGTH) {
UnloadTexture(txtr);
-
- Image imgy = ImageFromImage((front_sheet.img),croprec);
+ Image imgy = LoadImage("aichan-front-sheet.png");
+ ImageCrop(&imgy,croprec);
//ImageCrop(&imgy, croprec);
txtr = LoadTextureFromImage(imgy);
UnloadImage(imgy);
time_since_switch = 0.0;
+ if (croprec.x < front_sheet.width_each * (front_sheet.columns - 1)) {croprec.x += front_sheet.width_each;} else {croprec.x = 0;};
}
DrawTexture(txtr, player.rect.x, player.rect.y, WHITE);