Diddy array out of bounds..
Monkey Forums/Monkey Programming/Diddy array out of bounds..
| ||
Field sprite:Image Field frame:Int Method New(nx:Int,ny:Int) Self.x=nx Self.y=ny Self.sprite = game.images.Find("SpriteSheet").image Self.sprite.GrabImage(0,0,54,54,7) End Method Method Draw() 'AssertNotNull(Self.sprite,"Error Playing Image not Found") DrawImage(Self.sprite,100,100,1) End Method I have , I think peeps call it an Atlas these days, big sprite sheet, 1024 * 1024, the top line of this has about 6 or 7 sprites 54*54 that I want to grab out as my player animation strip. I am using the Diddy Images.Load to load in the SpriteSheet, then in my player class, I am trying to take that massive sheet of sprites and with grab image, take out the top line of player ships, and load them into the Sprite for the class. but its throwing me an array out of bounds. I had a look at the Diddy framework and there is code there to loadanim strips, but it does not look to me like it supports taking anim strips out of the middle of an atlas image. |