SpriteViewController
@objc(PESDKSpriteViewController)
open class SpriteViewController : ViewController
extension SpriteViewController: PhotoEditModelSettable
extension SpriteViewController: CanvasViewDataSource
extension SpriteViewController: CanvasViewDelegate
A SpriteViewController
is supposed to be added above a PhotoEditPreviewController
.
It uses the PhotoEditModel
to display SpriteView
s corresponding to SpriteModel
s and it
reacts to changes in the PhotoEditModel
by adding, changing or deleting SpriteView
s.
-
An object that acts as a delegate.
Declaration
Swift
open weak var delegate: SpriteViewControllerDelegate?
-
The
SpriteContainerView
that this view controller uses.Declaration
Swift
open var spriteContainerView: SpriteContainerView { get }
-
The
AssetManager
that this view controller can use to set and get assets.Declaration
Swift
open var assetManager: AssetManager?
-
The
AssetCatalog
that is associated with this view controller.Declaration
Swift
public var assetCatalog: AssetCatalog { get set }
-
The size of the untransformed preview image. This is used to denormalize the normalized values.
Declaration
Swift
open var referenceSize: CGSize { get set }
-
The size of the transformed preview image. This is used to calculate the position within the view.
Declaration
Swift
open var currentSize: CGSize { get set }
-
The photo edit model.
Declaration
Swift
open var photoEditModel: PhotoEditModel { get set }
-
Creates a new
SpriteViewController
object.Declaration
Swift
public required init(productType: LicenseProduct)
Parameters
productType
The product that this sprite view controller is used in.
-
Called by a
UITapGestureRecognizer
to select a sprite. You shouldn’t need to call this method directly.Declaration
Swift
@objc open func tapped(_ gestureRecognizer: UITapGestureRecognizer)
-
Start playback of all animated sprites.
Declaration
Swift
open func play(at time: CMTime? = nil, with trimStartTime: CMTime? = nil)
Parameters
time
If not
nil
the animation is seeked to the corresponding absolute time point of the trimmed output video.trimStartTime
The trim start time that will be subtracted from
time
. Ifnil
the trim start time of thephotoEditModel
will be used. -
Pause playback of all animated sprites.
Declaration
Swift
open func pause(at time: CMTime? = nil, with trimStartTime: CMTime? = nil)
Parameters
time
If not
nil
the animation is seeked to the corresponding absolute time point of the trimmed output video.trimStartTime
The trim start time that will be subtracted from
time
. Ifnil
the trim start time of thephotoEditModel
will be used. -
Seek playback position of all animated sprites.
Declaration
Swift
open func seek(to time: CMTime, with trimStartTime: CMTime? = nil)
Parameters
time
The corresponding absolute time point of the trimmed output video.
trimStartTime
The trim start time that will be subtracted from
time
. Ifnil
the trim start time of thephotoEditModel
will be used.
-
Posts a
.PESDKDidSelectSprite
notification with the givenSpriteView
.Declaration
Swift
open func selectSpriteView(_ spriteView: SpriteView?)
Parameters
spriteView
The sprite view that was selected or
nil
if no view was selected.
-
Returns the
SpriteView
at a given point, if any.Declaration
Swift
open func spriteView(at point: CGPoint) -> SpriteView?
Parameters
point
The location to check for a sprite view.
Return Value
The sprite view at the given point or
nil
. -
Returns the
SpriteView
with the givenUUID
, if any.Declaration
Swift
open func spriteView(with uuid: UUID) -> SpriteView?
Parameters
uuid
The
UUID
of the sprite view.Return Value
The sprite view with the
UUID
ornil
.
-
The custom watermark view.
Declaration
Swift
open var customWatermarkView: UIImageView?
-
This is a boxed property which exposes a Swift struct to Objective-C. This property should only be used if you are using Objective-C.
Every invocation of the getter will return a new (temporary) object wrapping the underlying Swift struct. Boxed properties cannot be chained with the dot syntax for mutable access of nested properties in place. Use the setter with the assignment operator instead to modify boxed properties, e.g.:
PESDKPhotoEditModel *photoEditModel = [[PESDKPhotoEditModel alloc] init]; // CORRECT: // get boxed `AdjustmentModel` PESDKAdjustmentModel *adjustmentModel = photoEditModel.adjustmentModel; // modify boxed `AdjustmentModel` adjustmentModel.brightness = 0.5; // set modified boxed `AdjustmentModel` photoEditModel.adjustmentModel = adjustmentModel; // WRONG: photoEditModel.adjustmentModel.brightness = 0.5;
Declaration
Swift
var boxedPhotoEditModel: _ObjCPhotoEditModel { get set }