2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
A7.70 - how to use video_aspect in C-Script?
#251297
02/12/09 12:29
02/12/09 12:29
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
I thought that C-Script was still fully supported.. From version A7.66, there is this new feature: - View.aspect is now relative to the primary monitor format, instead of a theoretical 4:3 monitor. If this is undesired, set the compatibility variable to 7 or below.
- Wide screen video formats are now automatically selected when the primary monitor has a wide screen. If this is undesired, set video_aspect to 4/3 before the first frame.
http://manual.conitec.net/newfeatures70.htmThe problem is: In C-Script, you can not execute code before the first frame. Setting video_aspect on the beginning of the main function leads so "video_aspect is read only" error. Giving it a value through redefining it (var video_aspect = 1.333;) doesn't have any effect. Setting compability to 7 doesn't to anything, neither. So how can you have the engine start with non-widescreen resolutions on a system with a widescreen display, apart from calling video_set? For 2D Games, this behaviour is undesired. Thanks, SchokoKeks
|
|
|
Re: A7.70 - how to use video_aspect in C-Script?
[Re: SchokoKeks]
#252670
02/19/09 14:59
02/19/09 14:59
|
Joined: Sep 2003
Posts: 733 Whitefish, Montana
JazzDude
User
|
User
Joined: Sep 2003
Posts: 733
Whitefish, Montana
|
According to one of my beta testers this code from the forum works, but I don't have a wide-screen monitor so I haven't tested it personally. Put it in the main function. video_set(1024,768,24,1);
desktopWidth = sys_metrics(0);
desktopHeight = sys_metrics(1);
if (desktopWidth<1681)
{
video_set(desktopWidth,desktopHeight,0,1);
}
else
{
if (desktopWidth/4 == desktopHeight/3) //Classic
{
video_set(1024,768,0,1);
desktopWidth = 1024;
desktopHeight = 768;
}
if (desktopWidth/15 == desktopHeight/9) //BrightView
{
video_set(1280,768,0,1);
desktopWidth = 1280;
desktopHeight = 768;
}
if (desktopWidth/5 == desktopHeight/4) //SXGA
{
video_set(1280,1024,0,1);
desktopWidth = 1280;
desktopHeight = 1024;
}
if (desktopWidth/16 == desktopHeight/10) //WSXGA+
{
video_set(1680,1050,0,1);
desktopWidth = 1680;
desktopHeight = 1050;
}
else //Window Mode
{
video_set(1024,768,32,2);
video_window(nullvector,nullvector,1,NULL);
wait(1); // must put this. not sure the reason
desktopWidth = screen_size.x;
desktopHeight = screen_size.y;
}
}
|
|
|
|