IsPersonVisible
From Spheriki
Check whether or not a person is drawn or not.
Contents |
Usage
- name String. The name of the person to check the visibility of.
- boolean is returned:
trueif the person is visible,falseif the person is invisible.
Examples
Persons are usually only invisible if they have been explicitly set to invisible using SetPersonVisible().
var person_name = "Jack"; CreatePerson(person_name, "your_spriteset_filename_here.rss", false); SetPersonVisible(person_name, false); var visible = IsPersonVisible(person_name);
In the above code sample, visible would have the value false. This function can also be used in conditional expressions directly:
if (IsPersonVisible("Phoebe")) {
// Do stuff for visible Phoebe
} else {
// Do stuff for invisible Phoebe
}
Notes
- Visibility in this context means the flag used by Sphere's map engine to determine whether or not to draw the person. A person may have a position off-screen and still be considered visible.
- To change the visibility of a person, use SetPersonVisible().