|
background_exists - checks whether a background with a specified index exists. Syntaxbackground_exists ( ind );
Explanationbackground_exists() checks if a background with a specified index exists and returns 0 if doesn't exist or 1 if does exist. ExamplesFields of GreyLoads a background image from a file and draws it on the screen. Create an object which for this example I will leave as object0. The Draw Event of object0 will check for the existence of the newback index. As such we will want to define it and initialize it in the Create Event.
If there is a file named grass.gif on the c: drive in the root directory then the following code will work. If there isn't, then please make sure that you place the correct filename's path in single quotes.
As exciting as it is to load a background image from a file, if we don't draw it then the player will never see it. The following is one method of doing this. First it checks to make sure that the background exists and if it does then it will tile it.
|
Related PagesBacklinks |
Background Exists