I have a couple of split panels nested inside of each other. The problem is, I’m rendering an 8×8 tiled game inside of the center panel. Basically, the height and width of the panel need to be an odd multiples of 8 so I can find the center tile displayed easily.
I’m using VB.net so all .net solutions are acceptable 🙂
EDIT sorry, that was confusing a bit…
I mean, I need the width and height to be divisible by 8. The number 8 is multiplied by should be odd:
EDIT AGAIN these numbers below do not refer to the size. They refer to two number being multiplied. I’ve changed them to a * to show this. These numbers below apply to both the height and width. One number should be odd, the other 8. 8*x
5*8 – Good
6*8 – Bad
You can check if something is odd by doing mod 2 to the number. So just do