My animation I used for the sprite sheet is 9 frames long and 128x128, but if I used a 3x3 grid it would be 384x384, which is not a power of two, so I am using 512x512, which is a 4x4 grid for the 128x128 images, would this be ok to use the 512x512 or not?
That sounds right! You would fill the first two rows and then the first space in the third row, leaving 7 128x128 blocks empty.
Think of it like this: find the smallest power of two that gives you all your frames (ie 9).
Since you have 9 frames, we have
- 1
- 2
- 4
- 8
- 16
- 32
- 64
- … etc
so the smallest power of two that works is 16, so you need a grid that is Nx128-pixels wide and Mx128 pixels high, such than NxM = 16. (The neatest choice for N and M is 4 and 4.)
If you wanted to make 20 frames/sprites, you would need 32-grid-blocks, with the last 12 (32-20) regions going to be left empty. Then solve Nx128 and Mx128 such that NxM=32. And here a neat choice would be N=8, M=4 (you want N and M to be powers of two as close to each other as possible).
Thanks for the clarification, Ken, and Gregory!