Closed mkeeter closed 12 years ago
This feature has been removed in the new graphics API in SFML 2. I believe VertexArray
should be used if you want more features, but I couldn't find a recent Laurent post about this.
Note that I haven't added VertexArray
in the Python binding, because I don't feel like it's more useful than calling RenderTarget.draw()
with a list of Vertex
objects. If I remember correctly, the only thing VertexArray
does is remembering the primitive type across draw()
calls. But I've never used this kind of stuff in my personal projects, so if someone else needs it I can add it.
Rock on - it's easy enough to create a vertex list, so this solves my problem.
For reference, creating a multi-color rectangle is done with the code
target.draw([sfml.Vertex((0,0), sfml.Color(255,255,255)),
sfml.Vertex((1,0), sfml.Color(255,0,0)),
sfml.Vertex((1,1), sfml.Color(0,255,0)),
sfml.Vertex((0,1), sfml.Color(0,0,255))],
sfml.QUADS)
Hi Bastien,
In an earlier version of this library, it was possible to generate a shape with per-point coloring, e.g.
Is there a way to do this with the current library version?