Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | List of all members
SkottieViewController Class Reference

#include <SkottieViewController.h>

Inheritance diagram for SkottieViewController:
SkiaViewController

Instance Methods

(void) - draw:toCanvas:atSize:
 
(bool) - isPaused
 
(void) - setStopAtEnd:
 
(bool) - loadAnimation:
 
(void) - seek:
 
(bool) - togglePaused
 
(CGSize) - size
 
(float) - animationDurationSeconds
 
(float) - currentTime
 

Detailed Description

Definition at line 11 of file SkottieViewController.h.

Method Documentation

◆ animationDurationSeconds

- (float) animationDurationSeconds

Definition at line 130 of file SkottieViewController.mm.

141{ return fClock.duration(); }
SkTimeKeeper fClock

◆ currentTime

- (float) currentTime

Definition at line 130 of file SkottieViewController.mm.

143{ return fDraw ? fClock.currentTime() : 0; }

◆ draw:toCanvas:atSize:

- (void) draw: (CGRect)  rect
toCanvas: (SkCanvas*)  canvas
atSize: (CGSize)  size 

Reimplemented from SkiaViewController.

Definition at line 130 of file SkottieViewController.mm.

160 :(CGRect)rect toCanvas:(SkCanvas*)canvas atSize:(CGSize)size {
161 // TODO(halcanary): Use the rect and the InvalidationController to speed up rendering.
162 if (rect.size.width > 0 && rect.size.height > 0 && fDraw && canvas) {
163 if (!fClock.paused()) {
164 fDraw.seek(fClock.currentTime());
165 }
166 fDraw.draw(SkSize{(float)size.width, (float)size.height}, canvas);
167 }
168}
if(end==-1)
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
int32_t height
int32_t width
SkScalar width() const
Definition SkSize.h:76

◆ isPaused

- (bool) isPaused

Reimplemented from SkiaViewController.

Definition at line 130 of file SkottieViewController.mm.

158{ return fClock.paused(); }

◆ loadAnimation:

- (bool) loadAnimation: (NSData*)  d

Definition at line 130 of file SkottieViewController.mm.

133 :(NSData*) data {
134 fDraw.load((const void*)[data bytes], (size_t)[data length]);
135 fClock.setDuration(fDraw.duration());
136 return (bool)fDraw;
137}
void setDuration(float d)
size_t length

◆ seek:

- (void) seek: (float)  seconds

Definition at line 130 of file SkottieViewController.mm.

145 :(float)seconds {
146 if (fDraw) {
147 fClock.seek(seconds);
148 }
149}
void seek(float seconds)

◆ setStopAtEnd:

- (void) setStopAtEnd: (bool)  stop

Definition at line 130 of file SkottieViewController.mm.

139:(bool)stop { fClock.setStopAtEnd(stop); }
void setStopAtEnd(bool s)

◆ size

- (CGSize) size

Definition at line 130 of file SkottieViewController.mm.

151{ return {(CGFloat)fDraw.size().width(), (CGFloat)fDraw.size().height()}; }

◆ togglePaused

- (bool) togglePaused

Reimplemented from SkiaViewController.

Definition at line 130 of file SkottieViewController.mm.

153 {
155 return fClock.paused();
156}

The documentation for this class was generated from the following files: