Is it not possible to put a variable into a DisplayAtY expression?
DisplayAtY(200, "Cats are on the prowl... they manage to kill %d of your rats", num)
returns the error wrong number of parameters in call to 'DisplayAtY' - it works fine with Display but I want to position the text displayed. Am I missing something obvious or is it simply a limitation of this particular function? I can't find anything explicit in the manual about this.
Only functions that have "..." in the parameter list may take extra variables to format a string. This is called "variadic function".
Compare:
Display (string message, ...)
DisplayAt(int x, int y, int width, string message, ...)
But
DisplayAtY(int y, string message)
When you need to pass a string somewhere that does not have "...", use String.Format to create a string:
DisplayAtY(200, String.Format("Cats are on the prowl... they manage to kill %d of your rats", num));
Brilliant, thanks so much CW!!