| OLD | NEW |
| 1 part of sprites; | 1 part of sprites; |
| 2 | 2 |
| 3 class _Particle { | 3 class _Particle { |
| 4 Vector2 pos; | 4 Vector2 pos; |
| 5 Vector2 startPos; | 5 Vector2 startPos; |
| 6 | 6 |
| 7 double colorPos; | 7 double colorPos; |
| 8 double deltaColorPos; | 8 double deltaColorPos; |
| 9 | 9 |
| 10 double size; | 10 double size; |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 276 } |
| 277 | 277 |
| 278 double randMinus1To1() => _rand.nextDouble() * 2.0 - 1.0; | 278 double randMinus1To1() => _rand.nextDouble() * 2.0 - 1.0; |
| 279 } | 279 } |
| 280 | 280 |
| 281 // TODO: Needs bindings to Skia method in SkCanvas (exclude canvas parameter) | 281 // TODO: Needs bindings to Skia method in SkCanvas (exclude canvas parameter) |
| 282 void drawAtlas(Canvas canvas, Image image, List<RSTransform> transforms, List<Re
ct> rects, List<Color> colors, | 282 void drawAtlas(Canvas canvas, Image image, List<RSTransform> transforms, List<Re
ct> rects, List<Color> colors, |
| 283 TransferMode transferMode, Paint paint) { | 283 TransferMode transferMode, Paint paint) { |
| 284 assert(transforms.length == rects.length && transforms.length == colors.length
); | 284 assert(transforms.length == rects.length && transforms.length == colors.length
); |
| 285 | 285 |
| 286 Paint paint = new Paint(); | |
| 287 | |
| 288 Texture mainTexture = new Texture(image); | 286 Texture mainTexture = new Texture(image); |
| 289 | 287 |
| 290 for (int i = 0; i < transforms.length; i++) { | 288 for (int i = 0; i < transforms.length; i++) { |
| 291 RSTransform transform = transforms[i]; | 289 RSTransform transform = transforms[i]; |
| 292 Rect rect = rects[i]; | 290 Rect rect = rects[i]; |
| 293 Color color = colors[i]; | 291 Color color = colors[i]; |
| 294 | 292 |
| 295 canvas.save(); | 293 canvas.save(); |
| 296 | 294 |
| 297 Matrix4 matrix = new Matrix4(transform.scos, transform.ssin, 0.0, 0.0, | 295 Matrix4 matrix = new Matrix4(transform.scos, transform.ssin, 0.0, 0.0, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 312 | 310 |
| 313 // TODO: Needs bindings to Skia SkRSXform | 311 // TODO: Needs bindings to Skia SkRSXform |
| 314 class RSTransform { | 312 class RSTransform { |
| 315 double scos; | 313 double scos; |
| 316 double ssin; | 314 double ssin; |
| 317 double tx; | 315 double tx; |
| 318 double ty; | 316 double ty; |
| 319 | 317 |
| 320 RSTransform(this.scos, this.ssin, this.tx, this.ty); | 318 RSTransform(this.scos, this.ssin, this.tx, this.ty); |
| 321 } | 319 } |
| OLD | NEW |