Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Origins: Coordinates vs. fractions  (Read 7820 times)

0 Members and 1 Guest are viewing this topic.


  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Origins: Coordinates vs. fractions
« Reply #15 on: September 11, 2012, 11:01:37 pm »
But using sf::Transformable would probably be heavier.
That's true, and getters/setters become more complicated in usage, unless I provide a ton of them.
particle.color.a = alpha;
// vs
sf::Color color = particle.getColor().a;
color.a = alpha;

sorry, I have no idea how your API works ;D
No problem, cool that you're interested ;)

There is the particle system which stores, updates and renders all the particles. Emitters and affectors can be attached to a particle system, they are invoked each frame. The particle system also contains the texture, all particles in one system use the same texture.

The emitters create new particles, set their initial conditions and add them to the system. An emitter can contain a position (or rather a position distribution, to allow spawning in a circle for example) according to which each particle is initialized. Same for the other particle properties. User-defined emitters are possible through classical inheritance and polymorphism.

The affectors can change the particle's attributes over time. Position, rotation and lifetime are automatically updated by the particle system, other attributes like color are modified by the affectors. Like emitters, the user can write his own affector classes by implementing a virtual function.

For in-depth information, you can take a look at the tutorial or the API docs.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:


  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Origins: Coordinates vs. fractions
« Reply #16 on: September 11, 2012, 11:37:22 pm »
Ok, I see. Thanks :)
Laurent Gomila - SFML developer