Comments (2)
the confetti all animate based on their physics attributes such as velocity and acceleration. Simply making those values negative would allow you to fly from bottom to top.
from confetti.
hi i need this effect but i am not sure how to achieve this here is my implementation so far:
final ConfettoGenerator confettoGenerator = new ConfettoGenerator() { @Override public Confetto generateConfetto(Random random) { final Bitmap bitmap = allPossibleConfetti.get(random.nextInt(numConfetti)); return new BitmapConfetto(bitmap); } };
final int containerMiddleX = viewGroup.getWidth() / 2;
final int containerMiddleY = viewGroup.getHeight() / 2;
int size;
int velocitySlow, velocityNormal;
size = getResources().getDimensionPixelSize(R.dimen.big_confetti_size);
velocitySlow = getResources().getDimensionPixelOffset(R.dimen.default_velocity_normal);
velocityNormal = getResources().getDimensionPixelOffset(R.dimen.default_velocity_fast);
final ConfettiSource confettiSource = new ConfettiSource(0, -size, viewGroup.getWidth(), -size);
new ConfettiManager(LoginActivity.this, confettoGenerator, confettiSource, viewGroup)
.setEmissionDuration(1500)
.setEmissionRate(30)
.setVelocityX(0, velocitySlow)
.setVelocityY(velocityNormal, velocitySlow)
.setRotationalVelocity(180, 90)
.animate();
}
});
from confetti.
Related Issues (20)
- how to stop the one shot rain, I can't call start activity when it is animating. HOT 3
- "emit" method to create one particle just in time HOT 1
- Not working inside an onanimationEnd HOT 1
- Simple Customizations HOT 2
- explosion() is not working HOT 5
- A Tip of lower CPU usage HOT 1
- does not work on honor/huawei HOT 1
- Which license do you use? HOT 4
- Add shape method
- unable to show confetti on click of button HOT 1
- Fixed the crash on the terminate method
- Cant change X and Y values of confettiManager after initialization.
- Custom Confetti with Explosion HOT 1
- I want to start the confetti when an activity gets started. But there is no way to do so. HOT 2
- [CRASHED] Views added to a FragmentContainerView must be associated with a Fragment.
- [CRASH] Views added to a FragmentContainerView must be associated with a Fragment HOT 1
- How to stop infinite rainingConfetti ? HOT 1
- Split init logic, exclude View dependencies from constructor
- ConfettiAnimationListener.onAnimationEnd is called twice.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from confetti.