Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / [SOLVED] An issue with tiled sprite loading
- - By XxionxX Date 2015-10-12 03:12 Edited 2015-10-12 05:09
Hello,

I was attempting to learn how to use 'Gosu::Image::load_tiles' when I came across and issue.

This is the code I am using:

https://gist.github.com/XxionxX/7d6c2a2de10b80af67d5

When I load 'bard.png' in both fields, the code runs just fine. But when I try to use the 'kenney_16x16.png' my Gosu window hangs and then Ubuntu asks me if I want to force the program to quit.

I have tried everything under the sun to understand why some png images produce this behaviour and some don't. I have even tried to change image formats with gimp into bmp images. They still produce the same error.

Is there some crucial knowledge about potential sprite images which I should know about? I took these sprites from: http://opengameart.org if that makes any difference.

Here are the two images I use in my example:



and



Edit: Thanks to shawn42's sleuthing I found out my second image was simply too large! We cut the image down to size, and everything worked normally!

shawn42 cut down the sheet from 6912 16x16 tiles to 1024 16x16 tiles and it worked great. 2048 16x16 tiles caused a slowdown though.

Here is some additional reading for people having issues with tile sheets: https://github.com/shawn42/killbox/blob/master/data/graphics/trippers/red_tripper.png
Parent - By shawn42 Date 2015-10-12 20:54
I think you meant to post this link from our conversation:
https://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=534
Up Topic Gosu / Gosu Exchange / [SOLVED] An issue with tiled sprite loading

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill