Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c9284dff
Commit
c9284dff
authored
Jul 30, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #402 from vlidholt/master
Fixes anchor points for particles in particle systems
parents
18682227
f39dcbb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
particle_system.dart
packages/flutter/example/game/lib/particle_system.dart
+9
-5
No files found.
packages/flutter/example/game/lib/particle_system.dart
View file @
c9284dff
...
...
@@ -300,6 +300,10 @@ class ParticleSystem extends Node {
_paint
.
setTransferMode
(
transferMode
);
for
(
_Particle
particle
in
_particles
)
{
// Rect
Rect
rect
=
texture
.
frame
;
rects
.
add
(
rect
);
// Transform
double
scos
;
double
ssin
;
...
...
@@ -314,13 +318,13 @@ class ParticleSystem extends Node {
scos
=
particle
.
size
;
ssin
=
0.0
;
}
RSTransform
transform
=
new
RSTransform
(
scos
,
ssin
,
particle
.
pos
[
0
],
particle
.
pos
[
1
]);
double
ax
=
rect
.
width
/
2
;
double
ay
=
rect
.
height
/
2
;
double
tx
=
particle
.
pos
[
0
]
+
-
scos
*
ax
+
ssin
*
ay
;
double
ty
=
particle
.
pos
[
1
]
+
-
ssin
*
ax
-
scos
*
ay
;
RSTransform
transform
=
new
RSTransform
(
scos
,
ssin
,
tx
,
ty
);
transforms
.
add
(
transform
);
// Rect
Rect
rect
=
texture
.
frame
;
rects
.
add
(
rect
);
// Color
if
(
particle
.
simpleColorSequence
!=
null
)
{
Color
particleColor
=
new
Color
.
fromARGB
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment