video_window problem

Posted By: hopfel

video_window problem - 08/27/10 19:34

Hey guys

I've got a little problem with wideo_window;
I want to change the border ingame, nothing easyer than that, I though.
So I wrote this line in a button function, which should switch between "with border" and "less border":

Code:
var mom_rand=0;

function window_rand()
{
if(mom_rand==0)
{
video_window(nullvector,screen_size,16,"my game");
mom_rand=1;}
else
{
video_window(nullvector,screen_size,1,"my game");
mom_rand=0;}}



When I press the button ingame, the border comes, but the window gets smaller too, but not the resolution, so it gets blurred.
The manual says, I should use "screen_size", but how you can see I did and it didn't change anything.

Thx for help wink
Posted By: Lukas

Re: video_window problem - 08/27/10 19:57

You can use video_set wink
Posted By: hopfel

Re: video_window problem - 08/28/10 07:30

Ok, this code works:

Code:
var auflx=800;
var aufly=800;
video_window(nullvector,vector(auflx,aufly,0),16,"my game");
auflx-=6; //border length
aufly-=32; //border breadth
video_set(auflx,aufly,0,2);



Thank you ^^

The only thing I have to know now, if the border has the same size at Vista or Win7, else it would only work on XP...
Posted By: MrGuest

Re: video_window problem - 08/28/10 09:39

it's possible to get application border sizes with sys_metrics
Posted By: Lukas

Re: video_window problem - 08/28/10 11:52

I think you don't have to exclude the border, as video_window already sets the window size excluding the window border.
Posted By: hopfel

Re: video_window problem - 08/28/10 12:55

Code:
as video_window already sets the window size excluding the window border.


Manual:
When the border style is changed,
the size vector should also be set
to the current engine resolution (screen_size).
Otherwise the window will keep its previous size,
but due to the changed border
the inner client area has now a different size

and will appear distorted.

If I understood it right, the window_size includes the border.
The problem is just, that this suggestion with "screen_size" doesn't work. -.o'
Posted By: Lukas

Re: video_window problem - 08/28/10 13:00

"When the border style is changed, ..." wink

What this means is, that if you change the border style (what you didn't), you have to set (update) the size of the engine window, or it will keep its old size, which based on the old border size.

Trust me, it worked for all my projects, and the screen never looked distorted and according to screenshots (not F6) it always has the correct size.
Posted By: hopfel

Re: video_window problem - 08/28/10 13:27

Quote:
that if you change the border style (what you didn't),

Sorry, if I say something stupid, but isn't it a change from the borderstyle, when I do this:

www.haeschen.ch/hopfel/bilder/borderproblem.png

What ever, you can see, what the problem is like...
Posted By: Lukas

Re: video_window problem - 08/28/10 13:42

So, you did change the border? Well, that's only a problem if you did that independendly from changing the window size. If you changed the size and style of your window in the same video_window command, there is no problem.
Posted By: hopfel

Re: video_window problem - 08/28/10 13:58

Quote:
If you changed the size and style of your window in the same video_window command


Code:
var mom_rand=0;

function window_rand()
{
if(mom_rand==0)
{
video_window(nullvector,screen_size,16,"my game");
mom_rand=1;}
else
{
video_window(nullvector,screen_size,1,"my game");
mom_rand=0;}}



I guess I did.
Sorry, looks like I'm really to stupid to understand what you're trying to say. );
An example would be very nice.
Posted By: Lukas

Re: video_window problem - 08/28/10 14:14

Yes, you did. wink

video_window(nullvector,screen_size,16,"my game");

If the blue parameter is non-zero, the red one is required, otherwise the screen gets distorted (and only then).
Posted By: hopfel

Re: video_window problem - 08/28/10 14:25

Yes, and how you can see in my code, I did, but it nevertheless gets distortet. frown
Posted By: Lukas

Re: video_window problem - 08/28/10 14:28

Did you use the same size for video_windoe and video_set?
Posted By: hopfel

Re: video_window problem - 08/28/10 14:32

Jep I did.
And how I said, this works:

Code:
wait(20);
video_window(nullvector,screen_size,16,"Terraineditor");
auflx-=6;
aufly-=32;
video_set(auflx,aufly,0,2);



But only at XP and not at Vista or Win7, because the size of the border is another.
© 2024 lite-C Forums