HUD/IsAvailable
From Blue Mars Developer Guidebook
There are security restrictions on this article
|
|
This is a HUD function
Function
- IsAvailable()
- check if the HUD is ready to be used
- return value - boolean available
Usage
The HUD is not created immediately when a level is loaded, so sometimes it is appropriate to check if the HUD is ready before calling any other HUD function.
Examples
The Starte state of the sample molecule viewer waits to the HUD is available before loading a Flash movie.
ARMoleculeViewer.Start =
{
OnBeginState = function(self)
-- could use entity link, also
self.molecule = System.GetEntityByName(self.Properties.molecule);
end,
OnUpdate = function(self,delta)
if (HUD.IsAvailable()) then
ARLoadFlash(self.Properties.button,
{ visible=true,
dock=eFD_Pos,
pos={x=0.2,y=0.2},
handleEvents=true,
fscommand=self.id});
self:GotoState("Show");
end
end,
OnEndState = function(self)
end,
}
