Is there a function for this? And what about sprite dimensions? The alternatives seem a bit excessive.
On a related topic (since the above would solve this too), how does one find the depth ordering of overlapping objects/characters.
Sprite Dimensions (from the manual)
_____________________________
GetGameParameter
GetGameParameter (parameter, int data1, int data2, int data3)
Gets the value of various game properties which are wanted so rarely they don't have their own specific script command.
The possible values for PARAMETER are listed below. The data values depend on the command - if they are not required, simply pass them as 0.
Parameter Description
GP_SPRITEWIDTH Returns the width of sprite slot DATA1
GP_SPRITEHEIGHT Returns the height of sprite slot DATA1
GP_NUMLOOPS Returns the number of loops in view DATA1
GP_NUMFRAMES Returns the number of frames in loop DATA2 of view DATA1
GP_ISRUNNEXTLOOP Returns 1 if loop DATA2 of view DATA1 has "Run next loop after this" checked
GP_FRAMESPEED Returns frame speed setting of frame DATA3 in loop DATA2 of view DATA1
Example:
if (GetGameParameter(GP_SPRITEWIDTH, 10, 0, 0) > 20) {
Display("Sprite 10 is wider than 20 pixels!");
}
____________________________________
SetObjectBaseline
SetObjectBaseline (int object, int baseline)
Changes OBJECT's baseline to BASELINE. This modifies the line you can set in the editor. You can disable the baseline (and revert to using the base of the object's image on the screen) by passing 0 as the baseline. Otherwise, the baseline is the Y screen co-ordinate you want to use, normally from 1 to 200 unless you have a taller than usual room.
Example:
SetObjectBaseline(4,100);
will change object’s 4 baseline to a line positioned at y coordinate 100.
____________________-
Just pay attention to where you placed it in the game, and you could even set up your own room variables to keep track of where it is if its going to be constantly moving.
Ha! I was just about to update my question, but you were too quick for me.
Thanks ;D
I just discovered GetGameParameter().
Since I started using the page links instead of trusting the 'Contents' panel, I've been finding new things.
For baselines I was hoping to retrieve existing values, as might be set in the room editor, rather than adding extra parameters to everything. Avoiding explicit per-object data entry is one reason that I want the value in the first place.
But of course, the info you provided is sufficient to at least make it work, so thanks anyway.
[edit: damn this forum ignoring where I put the caret on the first click.]