For the float Problem when dividing the Sprite sheet

If anyone has issues with the nebula.width/8 and the Wnarrowing error, just add .f after

so:Rectangle nebRec{0.0, 0.0, nebula.width/8.f, nebula.height/8.f};

8.0 yields a double and that is also another data type, so the .f ensures the number is a float value


I solved it in another way thanks to ChatGTP.

Rectangle nebulaRec{0.0, 0.0, (float)nebula.width/8, (float)nebula.height/8};

Privacy & Terms