I created a 640x480 game yet get a resized 320x240 game? (SOLVED)

Started by SupSuper, Sat 21/04/2007 21:42:09

Previous topic - Next topic

SupSuper

Is this intentional? And in that case, is there a ScreenWidth/Height equivalent that gets the "real" width/height, filters considered?
Programmer looking for work

Rui 'Trovatore' Pires

Read the manual. It's all explained there, if I understand you correctly.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SupSuper

I have. Closest I found is ViewportWidth/Height, though I'm not sure if it's what I want, so if someone could clear it up for me.
Programmer looking for work

Rui 'Trovatore' Pires

It's not, as they

QuoteReturn the height of the current viewport. This is reported in 320x200-resolution units, and allows you to find out what the maximum co-ordinates you can pass to functions like Mouse.SetPosition are.

The fact that internally all games are 320x240 even when they're 640x480 games is mentioned at several points in the manual, although now that I come to think of it I don't remember of it being particularly clear or concise, it's sort of spread around.

What you want is similar, though.

QuoteScreenWidth property
(Formerly known as system.screen_width, which is now obsolete)

readonly static int System.ScreenWidth;

Returns the actual screen width that the game is running at. This could be 320, 640 or 800.
Note that if a graphic filter is in use, the resolution returned will be that before any stretching applied by the filter has been applied.

NOTE: This information is provided in case you need it to optimise your game, however please do not use it to force the player to run at a particular resolution. AGS is designed to allow players to choose different resolutions to help get the game working on their PC.

Example:

Display("Game is running at: %d x %d, %d-bit colour", System.ScreenWidth,
                                  System.ScreenHeight, System.ColorDepth);

will display the current resolution and colour depth
See Also: System.ColorDepth, System.ScreenHeight
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SupSuper

Well the problem is I was using ScreenWidth and ScreenHeight to check if the Mouse is near the edge of the screen, but that only works if there's no stretching applied. Seems to work fine with ViewportWidth and Viewport Height though, so I'll use that.

As for the 320x240/640x480, it's new to me. I think I read about it before, but I wasn't sure. But since GUIs are always 320x240-based, I assume I can't make 640x480-based (unresized) GUIs?
Programmer looking for work

Rui 'Trovatore' Pires

Right, well, without knowing what you wanted them for all I could do was tell you what you asked about. :) Glad it's working.

The 320x480 issue... best to think of it all as 640x480. After all, it doesn't stretch your images, really, they're still 640x480. Just the way that 800x600 are still 800x600 images, but internally they're processed as 400x300. Internally, AGS seems to rather "round up" things - you'll see what I mean when you try minutely positioning an object or a GUI control. This of it as a 640x480 game where you program in 320x240. Since even the little text on top of the room background gives you the coordinates in 320x240, it shouldn't be hard to adapt to it.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

SupSuper

Right, I'm sure I'll eventually run into a problem because of it :P but for know I'm fine, thanks for clearing it up.
Programmer looking for work

khnum


Don't worry, there's a trick to solve the problem when positioning objects: if you see that you can't put it where you want, because every pixel in 320x240 moves by 2 pixels in 640x480, just add a transparent line in the image, of one pixel, so it will go exactly where you want.
Hope I've been clear  ;)

SMF spam blocked by CleanTalk