I have an image file that has all the character sprites that I will be using in a game, and I want to make a layout that will allow the user to cycle through each image to be able to pick which one they want. So, 开发者_如何学CI have one large image, and I need to render just a small (32 x 32) section of it at a time. Is that possible with the layouts or will I have to use a canvas, and manually do most of this?
Yes Try using scrollX and scrollY. You can set these properties programmatically or in the layout xml.
That said, loading just the small images that the user needs to see is preferred to loading a large image containing all. If your image is really large you might want to consider the first option.
精彩评论