Flashlight: Difference between revisions

2,219 bytes added ,  21 November 2007
m
*>Monkey 05 06
*>Monkey 05 06
Line 34: Line 34:


'''NOTE:''' This property does '''NOT''' support sprites with an alpha channel as the sprite is flattened while creating the sprite for the GUI/Overlay.
'''NOTE:''' This property does '''NOT''' support sprites with an alpha channel as the sprite is flattened while creating the sprite for the GUI/Overlay.
''See Also:'' {{link||Flashlight.SetBeamSprite}}, {{link||Flashlight.ScreenSprite}}


====Flashlight.Enabled====
====Flashlight.Enabled====
''bool Flashlight.Enabled''
''bool Flashlight.Enabled''


Sets whether or not the flashlight effect will be enabled. If no BeamSprite is set then this property will be set to false until the BeamSprite is properly set.
Sets whether or not the flashlight effect will be enabled. If no {{link||Flashlight.BeamSprite|BeamSprite}} is set then this property will be set to false until the BeamSprite is properly set.
 
''See Also:'' {{link||Flashlight.SetBeamSprite}}


====Flashlight.FollowingCharacter====
====Flashlight.FollowingCharacter====
''writeprotected Character* Flashlight.FollowingCharacter''
''writeprotected Character* Flashlight.FollowingCharacter''


Returns the Character the flashlight beam is currently following (if any). If following the mouse or statically positioned this will return NULL. You can set the Character to follow using the Flashlight.SetFollowCharacter method.
Returns the Character the flashlight beam is currently following (if any). If following the mouse or statically positioned this will return NULL. You can set the Character to follow using the {{link||Flashlight.SetFollowCharacter}} method.
 
''See Also:'' {{link||Flashlight.SetFollowCharacter}}


====Flashlight.IsFollowingCharacter====
====Flashlight.IsFollowingCharacter====
''writeprotected bool Flashlight.IsFollowingCharacter''
''writeprotected bool Flashlight.IsFollowingCharacter''


Returns whether the flashlight beam is following any character (this is the same as checking whether the FollowingCharacter property is NULL). You can lock the flashlight's beam to a Character's position using the Flashlight.SetFollowCharacter method.
Returns whether the flashlight beam is following any character (this is the same as checking whether the {{link||Flashlight.FollowingCharacter|FollowingCharacter}} property is NULL). You can lock the flashlight's beam to a Character's position using the {{link||Flashlight.SetFollowCharacter}} method.
 
''See Also:'' {{link||Flashlight.FollowingCharacter}}, {{link||Flashlight.SetFollowCharacter}}, {{link||Flashlight.IsFollowingMouse}}, {{link||Flashlight.IsStatic}}


====Flashlight.IsFollowingMouse====
====Flashlight.IsFollowingMouse====
''writeprotected bool Flashlight.IsFollowingMouse''
''writeprotected bool Flashlight.IsFollowingMouse''


Returns whether the flashlight beam is following the mouse. You can lock the flashlight's beam to the mouse position using the Flashlight.SetFollowMouse method.
Returns whether the flashlight beam is following the mouse. You can lock the flashlight's beam to the mouse position using the {{link||Flashlight.SetFollowMouse}} method.
 
''See Also:'' {{link||Flashlight.SetFollowMouse}}, {{link||Flashlight.IsFollowingCharacter}}, {{link||Flashlight.IsStatic}}


====Flashlight.IsFollowingPlayer====
====Flashlight.IsFollowingPlayer====
''writeprotected bool Flashlight.IsFollowingPlayer''
''writeprotected bool Flashlight.IsFollowingPlayer''


Returns whether the flashlight's beam is following the player Character. This will not actually test if the FollowingCharacter property is set to the current player Character; rather it simply determines whether the FollowingCharacter property will be updated if the player changes. You can lock the flashlight's beam to follow the player Character using the Flashlight.SetFollowCharacter method.
Returns whether the flashlight's beam is following the player Character. This will not actually test if the {{link||Flashlight.FollowingCharacter|FollowingCharacter}} property is set to the current player Character; rather it simply determines whether the FollowingCharacter property will be updated if the player changes. You can lock the flashlight's beam to follow the player Character using the {{link||Flashlight.SetFollowCharacter}} method.
 
''See Also:'' {{link||Flashlight.FollowingCharacter}}, {{link||Flashlight.IsFollowingCharacter}}, {{link||Flashlight.SetFollowCharacter}}


====Flashlight.IsGUIMode====
====Flashlight.IsGUIMode====
''writeprotected bool Flashlight.IsGUIMode''
''writeprotected bool Flashlight.IsGUIMode''


Returns whether the flashlight is using a GUI. The benefit of using a GUI is the ability to set transparency using the Flashlight.Transparency property. You can set the flashlight to GUI mode using the Flashlight.SetGUIMode method.
Returns whether the flashlight is using a GUI. The benefit of using a GUI is the ability to set transparency using the Flashlight.Transparency property. You can set the flashlight to GUI mode using the {{link||Flashlight.SetGUIMode}} method.
 
''See Also:'' {{link||Flashlight.SetGUIMode}}, {{link||Flashlight.IsOverlayMode}}


====Flashlight.IsOverlayMode====
====Flashlight.IsOverlayMode====
''writeprotected bool Flashlight.IsOverlayMode''
''writeprotected bool Flashlight.IsOverlayMode''


Returns whether the flashlight is using an Overlay. The draw-back to using an Overlay instead of a GUI is that you cannot set transparency. You can set the flashlight to Overlay mode using the Flashlight.SetOverlayMode method.
Returns whether the flashlight is using an Overlay. The draw-back to using an Overlay instead of a GUI is that you cannot set transparency. You can set the flashlight to Overlay mode using the {{link||Flashlight.SetOverlayMode}} method.
 
''See Also:'' {{link||Flashlight.SetOverlayMode}}, {{link||Flashlight.IsGUIMode}}


====Flashlight.IsStatic====
====Flashlight.IsStatic====
''writeprotected bool Flashlight.IsStatic''
''writeprotected bool Flashlight.IsStatic''


Returns whether the flashlight's beam is statically positioned. This means that in order to move the flashlight you must manually modify the Flashlight.X and Flashlight.Y properties. You can lock the flashlight's beam to a static position using the Flashlight.SetStatic method.
Returns whether the flashlight's beam is statically positioned. This means that in order to move the flashlight you must manually modify the {{link||Flashlight.X}} and {{link||Flashlight.Y}} properties. You can lock the flashlight's beam to a static position using the {{link||Flashlight.SetStatic}} method.
 
''See Also:'' {{link||Flashlight.SetStatic}}, {{link||Flashlight.IsFollowingCharacter}}, {{link||Flashlight.IsFollowingMouse}}


====Flashlight.Radius====
====Flashlight.Radius====
Line 83: Line 101:
''bool Flashlight.ScaleBeam''
''bool Flashlight.ScaleBeam''


Controls whether the flashlight beam is scaled based on the scaling of the FollowingCharacter property. If not following a Character this does nothing. Note that the Flashlight.Radius property is NOT updated based upon any scaling, only the actual size of the beam will reflect this.
Controls whether the flashlight beam is scaled based on the scaling of the {{link||Flashlight.FollowingCharacter|FollowingCharacter}} property. If not following a Character this does nothing. Note that the {{link||Flashlight.Radius}} property is NOT updated based upon any scaling, only the actual size of the beam will reflect this.
 
''See Also:'' {{link||Flashlight.FollowingCharacter}}


====Flashlight.SetBeamSprite====
====Flashlight.SetBeamSprite====
''void Flashlight.SetBeamSprite(DynamicSprite* beamSprite)''
''void Flashlight.SetBeamSprite(DynamicSprite* beamSprite)''


Sets the sprite to use for the flashlight beam. NULL values will be rejected. It is possible to set an existing sprite as the beam sprite by passing DynamicSprite.CreateFromExistingSprite as the parameter. See Flashlight.BeamSprite for more information.
Sets the sprite to use for the flashlight beam. NULL values will be rejected. It is possible to set an existing sprite as the beam sprite by passing {{link|DynamicSprite functions and properties|DynamicSprite.CreateFromExistingSprite}} as the parameter. See {{link||Flashlight.BeamSprite}} for more information.
 
''See Also:'' {{link||Flashlight.BeamSprite}}


====Flashlight.SetFollowCharacter====
====Flashlight.SetFollowCharacter====
''void Flashlight.SetFollowCharacter(Character*, optional bool followPlayer)''
''void Flashlight.SetFollowCharacter(Character*, optional bool followPlayer)''


Locks the flashlight's beam to the Character's position. If (and only if) the Character passed is the current player AND followPlayer is TRUE (the default) the FollowingCharacter property will be locked to the PLAYER Character, updating if the player is changed; otherwise the beam will be locked exclusively to the position of the passed Character. Note that the Character MUST be in the current room or the beam will be locked to the mouse position instead.
Locks the flashlight's beam to the Character's position. If (and only if) the Character passed is the current player AND followPlayer is TRUE (the default) the {{link||Flashlight.FollowingCharacter|FollowingCharacter}} property will be locked to the PLAYER Character, updating if the player is changed; otherwise the beam will be locked exclusively to the position of the passed Character. Note that the Character '''MUST''' be in the current room or the beam will be locked to the mouse position instead.
 
''See Also:'' {{link||Flashlight.FollowingCharacter}}, {{link||Flashlight.IsFollowingCharacter}}


====Flashlight.SetFollowMouse====
====Flashlight.SetFollowMouse====
Line 99: Line 123:


Locks the flashlight's beam to the mouse's position.
Locks the flashlight's beam to the mouse's position.
''See Also:'' {{link||Flashlight.IsFollowingMouse}}, {{link||Flashlight.IsFollowingCharacter}}, {{link||Flashlight.IsStatic}}


====Flashlight.SetGUIMode====
====Flashlight.SetGUIMode====
Line 104: Line 130:


Sets the flashlight to use the passed GUI (if valid, otherwise defaults to Overlay mode).
Sets the flashlight to use the passed GUI (if valid, otherwise defaults to Overlay mode).
''See Also:'' {{link||Flashlight.IsGUIMode}}, {{link||Flashlight.IsOverlayMode}}, {{link||Flashlight.SetOverlayMode}}


====Flashlight.SetOverlayMode====
====Flashlight.SetOverlayMode====
Line 109: Line 137:


Sets the flashlight to use an Overlay.
Sets the flashlight to use an Overlay.
''See Also:'' {{link||Flashlight.IsOverlayMode}}, {{link||Flashlight.IsGUIMode}}, {{link||Flashlight.SetGUIMode}}


====Flashlight.SetStatic====
====Flashlight.SetStatic====
Line 114: Line 144:


Locks the flashlight's beam to its current (X,Y) position. You can move it manually by modifying the X/Y properties, or lock it back to the mouse (Flashlight.SetFollowMouse) or a Character (Flashlight.SetFollowCharacter) using the appropriate functions.
Locks the flashlight's beam to its current (X,Y) position. You can move it manually by modifying the X/Y properties, or lock it back to the mouse (Flashlight.SetFollowMouse) or a Character (Flashlight.SetFollowCharacter) using the appropriate functions.
''See Also:'' {{link||Flashlight.IsStatic}}, {{link||Flashlight.IsFollowingCharacter}}, {{link||Flashlight.IsFollowingMouse}}


====Flashlight.ScreenSprite====
====Flashlight.ScreenSprite====
Line 119: Line 151:


The DynamicSprite used to cover the screen. You can use this property to delete the DynamicSprite before you quit the game.
The DynamicSprite used to cover the screen. You can use this property to delete the DynamicSprite before you quit the game.
''See Also:'' {{link||Flashlight.BeamSprite}}


====Flashlight.Transparency====
====Flashlight.Transparency====
''int Flashlight.Transparency''
''int Flashlight.Transparency''


Sets the transparency for the (dark areas of the) flashlight effect. This is only valid if the flashlight is in GUI mode. This property is also passed through a bounding function similar to the way AGS's CHAR type works such that -1 will loop back around to 100, -2 to 99, -3 to 98, and 101 to 0, 102 to 1, 103 to 2, etc.
Sets the transparency for the (dark areas of the) flashlight effect. This is only valid if the flashlight is in {{link||GUI mode}}. This property is also passed through a bounding function similar to the way AGS's CHAR type works such that -1 will loop back around to 100, -2 to 99, -3 to 98, and 101 to 0, 102 to 1, 103 to 2, etc.
 
''See Also:'' {{link||Flashlight.IsGUIMode}}


====Flashlight.X====
====Flashlight.X====
''int Flashlight.X''
''int Flashlight.X''


Gets the X co-ordinate of the center of the flashlight beam. If the beam is statically positioned (Flashlight.SetStatic) you can also use this to set the X co-ordinate.
Gets the X co-ordinate of the center of the flashlight beam. If the beam is statically positioned ({{link||Flashlight.SetStatic}}) you can also use this to set the X co-ordinate.
 
''See Also:'' {{link||Flashlight.Y}}, {{link||Flashlight.IsStatic}}


====Flashlight.Y====
====Flashlight.Y====
''int Flashlight.Y''
''int Flashlight.Y''


Gets the Y co-ordinate of the center of the flashlight beam. If the beam is statically positioned (Flashlight.SetStatic) you can also use this to set the Y co-ordinate.
Gets the Y co-ordinate of the center of the flashlight beam. If the beam is statically positioned ({{link||Flashlight.SetStatic}}) you can also use this to set the Y co-ordinate.
 
''See Also:'' {{link||Flashlight.X}}, {{link||Flashlight.IsStatic}}


==Setup==
==Setup==
Anonymous user