Turn off Caption in runtime

For questions about using Classic.

Post » Fri Apr 29, 2011 7:32 pm

Hi

Can I turn off the caption border in runtime? I've tryed find a way to do this but don't know how, is it possible?

I want to disable it so I can make the game full screen if the player wants.. but also there is a window mode.

I don't know why but if I resize the game window to the current resolution of the player's monitor with caption ON the Y size of the new game's window doesn't get fueled..
example: the player's monitor resolution is 1440x900
I add a action to make it fullscreen with the window object, the new window size was to be 1446x928 but no, it will be 1446x916 and without the border size it should be 1440x900 but is 1440x888... by desabling the caption at runtime I could fix it..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Apr 29, 2011 8:20 pm

No, there is currently no way to do this unfortunately.

But there is some good news. The next build of Construct 0.x has a new feature that will change the window size properly:

[quote:1vmtaff4][ADD] Window: Three new actions (Set client width, Set client height, Set client size). These allow to set the window's dimensions based on the desired client's dimensions (e.g. 'set client size to (640, 480)' makes sure your desired game frame is 640x480 even if caption is selected, whereas 'set size to (640, 480)' is setting the outer boundaries of the window including caption bar and frame to 640x480, leaving less space for the game frame) (tulamide)[/quote:1vmtaff4]

I'm not sure when the next Construct build is being released, but it should be some time soon.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Apr 29, 2011 8:29 pm

K thanks ill wait for it..

but I think the error will still continue after this new update, because change the client size isn't a problem in the current version, just need to do some simple calculations... the problem is when u want to make the client size fullscreen with the caption on, the Y axis is smaller than it should be..
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Apr 29, 2011 8:45 pm

Oh wait... you're manually resizing the window to fill the screen? Huh. I guess I don't see the point. Why not just use the Maximize action for the Window object? Or maybe I'm still missing the point of what you're trying to do :P

Anyway, yes I suppose I see what you're saying about the Y axis being squished. The only real way around that I suppose is to create your own custom zooming algorithm that changes the Y zoom ratio, but it sounds like you're on the right track with that anyway.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Apr 29, 2011 9:02 pm

By using Maximize action the client size won't go full, only the full window size.
I want to simply make the client size fullscreen, not the window size, but the clientsize, but by doing this the Y size of the clientsize is a little smaller than what it should be.. why I don't know..

you can test by yourself by making a test game, select window width and heigth in the application properties and change to your current resolution, also select the option to show more content in 'resizing'(not really necessary) and enable caption. Test the game and check the current Client size, it's not what you added in the properties, at last here is not.

Add 1 text object and in events make always set text to: ClientWindow.Width&"x"&ClientWindow.Height
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Sat Apr 30, 2011 12:18 am

Right, yes. I did what you just said, and the result was as you say, the height is wrong.

The original reply I made in this thread will fix that issue, because the Set Client Width and Height will ensure that the viewable area of the window is exactly the size you designate.

As for toggling the caption and frame at runtime, no you still won't be able to do that, at least not yet.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Apr 30, 2011 12:55 am

Indeed, the size seems to be clamped somehow. On my 1920x1080-display I tried with 2400x1100 and got 1924x1058

All windows are childs of the desktop, but I'm not sure what causes this. The height could be a clamp to (desktop height - taskbar height), but it's wild guessing. Also, why then 1924 for the width? It is also in the current window object for the next build. I will have a look at it.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests