SOLVED: Cursor Coordinates

Started by Cerno, Sat 09/03/2013 13:04:26

Previous topic - Next topic

Cerno

Hello.

It took me a while to notice that there are (at least) two coordinate systems: Assuming the game runs in 640x480, but in scripts I have to normalize to 320x240. While I understand the necessity of having a unified coordinate system to allow switching resolutions without breaking the scripts, I found it a bit confusing that in the GUI the coordinates used are often the actual game coordinates (640x480), e.g. when specifying a walk-to point, while in scripts the internal coordinates (320x240), e.g. when placing a character are used.

Some thoughts about this:

1) Maybe it could be better documented in which case which coordinate system is used? Is it strictly scripts vs. GUI or are there exceptions to that?
2) Would it be possible to use the internal coordinate system (320x240) everywhere, also in the GUI (I guess there is a good reason for doing it like this)
3) This to my mind would really help: The GUI currently displays cursor coordinates which helps quickly finding a position on screen. Would it be possible to also display the internal coordinates so for scripts the developer would not have to translate between systems manually? I would naively assume that it would not be a lot of effort to implement. Also using well-defined names for each coordinate system would intuitively improve understanding of how to do things with coordinates.
123  Currently working on: Sibun - Shadow of the Septemplicon

Crimson Wizard

#1
There's an option "Use low-resolution coordinates in scripts". Can it be you set it to TRUE?
Because normally such things should not happen IIRC.

That option is only for backwards-compatibility (to make it easier to import older projects into new AGS editor)

Cerno

Ah, so I understood this incorrectly?
I was under the impression that the low resolution was an internal reference coordinate system.

So let's see if I understood this correctly now:

  • AGS does not use an artificial "reference coordinate system" for scripts.
  • The right way to do it is to switch "Use low-resolution coordinates in scripts" off.
  • Always use the actual coordinates (e.g. 640x480) in the GUI and the game.

Something like this?
I have no clue how I switched that option on, probably from messing around with the settings too much :/

Anyway thanks for your help, I'll try to change that presently.
123  Currently working on: Sibun - Shadow of the Septemplicon

Crimson Wizard

I am not quite sure myself, because this refers to old AGS versions, which existed before I ever joined AGS comminity, but I believe there once was "hard-coded" coordinate system in AGS (in 320x200 and 320x240 modes). In later versions it was deprecated. There's still this option to use "old way", but, as I mentioned above, it is useful only for importing very old projects into new editor.

Cerno

I changed what you suggested and it works nicely. Another stone off my back ;) Thanks.
123  Currently working on: Sibun - Shadow of the Septemplicon

SMF spam blocked by CleanTalk