LensStudio:Preview.Suspended
ClassPause reason reported while a preview is suspended, for example after LensPreview.pause().
Index
Properties
Example
Pause and resume a headless preview, and report whether it is suspended.
import { LensPreview } from 'LensStudio:LensPreview';
import { Suspended } from 'LensStudio:Preview';
export function isSuspended(preview: LensPreview): boolean {
return preview.pauseReason instanceof Suspended;
}
export function togglePause(preview: LensPreview): boolean {
if (isSuspended(preview)) {
preview.resume();
} else {
preview.pause();
}
return isSuspended(preview);
}
Constructors
Constructor
new Suspended():
Suspended
Constructs a Suspended value with an empty message.
Returns
Suspended
Properties
isResumable
readonlyisResumable:boolean
Whether the preview can be resumed from this state. Always true for Suspended.
isSuspending
readonlyisSuspending:boolean
Whether this reason suspends the preview input. Always true for Suspended.
message
readonlymessage:string
Explanation of why the preview is suspended, or an empty string if none was given.