adventuregamestudio / ags-manual

AGS documentation.
https://adventuregamestudio.github.io/ags-manual/
MIT License
26 stars 9 forks source link

Is SCR_NO_VALUE meant to be documented? #222

Closed morganwillcock closed 8 months ago

morganwillcock commented 8 months ago

Is SCR_NO_VALUE meant to be documented?

It only appears in the manual in one place, but there is no explanation of what the value is or why this "None" value uses it while others do not:

enum CharacterDirection {
  eDirectionDown = 0,
  eDirectionLeft,
  eDirectionRight,
  eDirectionUp,
  eDirectionDownRight,
  eDirectionUpRight,
  eDirectionDownLeft,
  eDirectionUpLeft,
  eDirectionNone = SCR_NO_VALUE
};
ivan-mogilko commented 8 months ago

SCR_NO_VALUE constant may be used in a number of functions when you want to skip certain optional arguments.

But it's not consistent for some reasons. For example:

clip.Play(SCR_NO_VALUE /*priority*/, eRepeat);

In this case priority will be assigned a clip's default, and eRepeat value used.

But in another case:

player.ChangeRoom(SCR_NO_VALUE, 100);

the engine only applies new position if all optional arguments have defined value, otherwise all are skipped.

morganwillcock commented 8 months ago

Since it is potentially still used and is present in example code posted on the forum, I've added it to the constants page in the manual and to the syntax highlighters.