Interface ICutscene
A cutscene is used to wrap a portion of the game together. This portion can then be skipped by the user. This is useful for things like introduction sequences, where you want the player to be able to skip over an intro that they've seen before.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface ICutscene
Properties
| Improve this Doc View SourceIsRunning
When the player chooses to skip a cutscene all of the script code is run as usual, but any blocking commands are run through without the usual game cycle delays.
Therefore, you should never normally need to use this property since cutscenes should all be handled automatically, but it could be useful for script modules.
if (cutscene.IsRunning)
{
//Do Something
}
Declaration
bool IsRunning { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSkipping
Returns whether the player has elected to skip the current cutscene. This will return true if the game is between a Start and End command, and the player has chosen to skip it. Although cutscene skipping is handled automatically by AGS, you can use this property to optimise the process by bypassing any lengthy blocks of code that don't need to be run if the cutscene is being skipped over.
Declaration
bool IsSkipping { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Examples
if (!cutscene.IsSkipping)
{
aScaryMusic.Play();
Thread.Sleep(100);
aScaryMusic.Stop();
}
|
Improve this Doc
View Source
SkipTrigger
Gets or sets what triggers skipping a cutscene (by default, pressing escape only to skip a scene, but this could be changed to be any key on the keyboard, any key or mouse click, or a custom skip trigger that you program yourself).
Declaration
SkipCutsceneTrigger SkipTrigger { get; set; }
Property Value
Type | Description |
---|---|
SkipCutsceneTrigger | The skip trigger. |
Methods
| Improve this Doc View SourceBeginSkip()
Programmatically instructs the cutscene to start skipping (if a cutscene is running).
Declaration
void BeginSkip()
CopyFrom(ICutscene)
Copies data from a different cutscene object.
Declaration
void CopyFrom(ICutscene cutscene)
Parameters
Type | Name | Description |
---|---|---|
ICutscene | cutscene | The cutscene object to copy data from. |
End()
Marks the end of a cutscene. If the player skips the cutscene, the game will fast-forward to this point. Be very careful with where you place the corresponding End command. The script must pass through it in its normal run in order for the skipping to work - otherwise, when the player presses ESC the game could appear to hang. This function returns false if the player watched the cutscene, or true if they skipped it.
Declaration
bool End()
Returns
Type | Description |
---|---|
System.Boolean |
Start()
Marks the start of a cutscene. Once your script passes this point, the player can choose to skip a portion by pressing a pre-configured button. This is useful for things like introduction sequences, where you want the player to be able to skip over an intro that they've seen before.
You need to mark the end of the cutscene with the End command. Be very careful with where you place the corresponding End command. The script must pass through it in its normal run in order for the skipping to work - otherwise, when the player presses ESC the game could appear to hang.
Declaration
void Start()