|
Post by neuroflux on Aug 7, 2014 3:22:21 GMT -8
Hey guys, So, I've managed to get multiple images outputted to the buffer and rendered fine on screen, but when I try to: GD.BitmapSize(BILINEAR, REPEAT, REPEAT, 480, 240);With an image of size 37x37, it renders.. broken. Originally I had one big image as a background, but to save memory I want tiles instead. You can download my sketch and asset file in zip format here: arduino.nuhack.com/gameduino2/platformer.zipThe issue seems to be on lines 300-310. Let me know what I can do to fix it! edit: here's a video of it working (with the large background images, not the tiles) www.youtube.com/watch?v=eAiJxU8kS8I
|
|
|
Post by jamesbowman on Aug 7, 2014 8:01:03 GMT -8
Tiling bitmaps (using REPEAT, REPEAT) must be a power of two. So to fix this you can...
(1) resize the tiles to 32x32 or 64x64. Note that you can have tiles of 64x64, and use a cmd_scale() to shrink them so each tile is 37x37:
cmd_scale(F16(37 / 64.0), F16(37 / 64.0)); cmd_setmatrix();
(2) use a 37x37 bitmap and draw each tile with Vertex2ii() or Vertex2f().
|
|
|
Post by neuroflux on Aug 7, 2014 8:10:42 GMT -8
Awesome, thank you James. Star!
|
|