U
Urto
Guest
Normally cameras and stuff don't get the better of me so badly, but I've been banging my head against the wall with this one for over an hour now and just can't figure it out. I create this grid for the player by repeating the same sprite multiple times on a surface and saving it as its own sprite. The obvious problem being that it looks warped and screwy.
Some lines/boxes are larger than others. Let's talk height specifically.
At 32 pixels per cell and 24 cells tall, the total height should be 728. In actuality, the grid winds up being around 660 pixels tall, a huge chunk missing. I'm 99% sure there's nothing wrong with the grid sprite itself. I've triple checked all the math during its creation and even saved the sprite to a file just to make sure it all looks good there. It does.
The thing that's bugging me is I'm just trying to get going on coding this (it's a new project) and wasn't even worrying about cameras. I didn't even have viewports enabled yet and hadn't even set up any type of camera object. The default height of the room is 728 pixels, exactly the height of the grid and so I upped it to create a bit of a buffer on end end, up to 800, 32 more pixels on each side. This is when I started noticing the distortion.
I figured I'd just circumvent the issue by setting the cameras and viewports to the exact dimensions as the room, but this doesn't fix anything. The screenshot of the warped grid above is with the following settings:
Ironically, if I set the camera and viewports heights to the room's STARTING size of 728, it looks dandy, but that makes even less sense to me. I understand all the differences between viewports and cameras but can't understand why this image would ever be warped with a room size, cam size, and viewport size that are all identical. Can anyone explain this to me?
Some lines/boxes are larger than others. Let's talk height specifically.
At 32 pixels per cell and 24 cells tall, the total height should be 728. In actuality, the grid winds up being around 660 pixels tall, a huge chunk missing. I'm 99% sure there's nothing wrong with the grid sprite itself. I've triple checked all the math during its creation and even saved the sprite to a file just to make sure it all looks good there. It does.
The thing that's bugging me is I'm just trying to get going on coding this (it's a new project) and wasn't even worrying about cameras. I didn't even have viewports enabled yet and hadn't even set up any type of camera object. The default height of the room is 728 pixels, exactly the height of the grid and so I upped it to create a bit of a buffer on end end, up to 800, 32 more pixels on each side. This is when I started noticing the distortion.
I figured I'd just circumvent the issue by setting the cameras and viewports to the exact dimensions as the room, but this doesn't fix anything. The screenshot of the warped grid above is with the following settings:
Ironically, if I set the camera and viewports heights to the room's STARTING size of 728, it looks dandy, but that makes even less sense to me. I understand all the differences between viewports and cameras but can't understand why this image would ever be warped with a room size, cam size, and viewport size that are all identical. Can anyone explain this to me?