First you need to find the screen resolution. Then you can do something like this: (lets say the reso is 800 x 600)
**NOTE*** This is not correct DB code, just an outline to give you an idea on what needs to be done.
I am not sure if this will work either. It will only work if the camera position is taken from directly center of the screen. If the camera position is taken from the top left corner of the screen, remove the division by 2.
iCamX1 = 800/2 `minimum x vaule for the camera
iCamY1 = 600/2 `minimum y value for the camera
iCamX2 = 2000 - 800/2 `maximum x value for the camera
iCamY2 = 2000 - 600/2 `maximum y value for the camera
if camera position x < iCamX1 then position camera x iCamX1
if camera position y < iCamY1 then position camera y iCamY1
if camera position x > iCamX2 then position camera x iCamX2
if camera position y > iCamY2 then position camera y iCamY2
Once again I stress that I dont know if this is correct DarkBasic code, you might need to correct it, and Im not 100% sure this works as I havnt tested it, I am just guessing that it does.
Current Project: CTA Beta
Lines: 825
Last Updated: 6/30/06 at 7:21 PM EST.