These are equations for when the view is on the outside border of the level, or at least that's what I want them to be, and they've worked so far (at least for me).
I did it on 1024x768 and 800x600, I checked it with at least 3 different window dimensions on both. 1024x768 is not proportionate to 800x600 although it is close, so I think I'll check on 800x600 again.
I do not want to do this based on tiles. The point of the script is to restrict the view to going into coordinates that are outside of the level (which causes the view to seem like it sticks to the side of the level), which you cannot do without something along the lines of these equations. If you do it by tiles then it is different for everyone with a different window size or resolution. If I'm incorrect with my equation, then I am close.
If screenheight and screenwidth are the size of the computer screen and not the window within which Graal is playing, I don't understand why this would work when you resize the window, although you're probably right about it because I know next to nothing about scripting, or at least that's what I say.
Quote:
Originally posted by faenix
screenwidth and screenheight measure the width and height of you screen not your level. that means that if your resolution is 800x600, screenheight returns 600 and screenwidth returns 800. likewise many computers use 1024x800, in which it would return a different value. screenwidth and screenheight return different values based on computer resolution.
the way you want to do it is based on tiles. the setfocus command doesn't work off of the position relative to the screen, it works off the position relative to the level. if you try setfocus 32,32; it should be centered in the screen. the reason your equation worked is because your screen size just happens to be the right size... for others it may not work so nicely
|