AbstractActors are %100 same with Mtx v1.0 with additional features;
- New constructor with DIPActive (we talked about this previously...)
- Particle Ready
POSITIONING AGAIN
Before moving on, I want to talk about positioning one more time to get things more clear
In top picture, you see heart, fire and particle effects, it is all same actor (testActor).
As you know my target world dimensions in app settings is 960x540, for this world I wanted to set testActor to position 600x250. But I want my actor to be same/similar position in every device on this planet. So, I multipled my position with;
600 * AppSettings.getWorldPositionXRatio()
250 * AppSettings.getWorldPositionYRatio()
So if my device resolution is 960x540 the position will be 600x250, if my device resolutuion is 800x480, actos position will be 600 * (800 / 960) for X-axis, and 250 * (480 / 540) for Y-axis. These will get me estimated positions for each device (But not perfect position because of many ratio differences in devices)
DIPActive constructor
Here example of extra new constructor for DIPActive calculations to auto-resize. There is no auto-positioning, it should be done manually like above example, if you need it.
testActor = new EmptyAbstractActor(150, 150, true);
ABSTRACTACTOR
As I said earlier it is same with Mtx v1.0. You can set everything for actors now
- Texture
- Animation
- Animation Momentary
- Particles
Here example of adding particle:
Particles created by particle editor, You can export the particle data (example: particle.p), and add them to
Android projects Assets/Data folder (If you use image in your particle add image as well)
Particle Editor: http://code.google.com/p/libgdx/wiki/ParticleEditor
0 yorum:
Yorum Gönder