Is it possible to repeat image until body is fully covered?
Posted: Sat Mar 01, 2014 10:50 pm
I'd like to attach images to some of your example scenes, but some of the grounds are fairly complicated. Is there an option to repeat image until body is fully covered? At the moment, the only way I can think of doing it is by creating an image of the ground before hand, importing it and then creating my own custom shape to fit image. Or I could just copy and paste the same image myself to fit body, but this would take forever on complicated shapes. Thanks.
EDIT: I believe I can create a textured mesh by querying the fixture's vertices. So far I have
but I don't know how to get each individual vertex. There is a method called getVertex which takes index and vertex as parameters, but it doesn't return any (void). Any ideas?
EDIT: I believe I can create a textured mesh by querying the fixture's vertices. So far I have
Code: Select all
PolygonShape cs = (PolygonShape) rubeDef.getFixtureByName("fixture0").getShape();
Vector2[] testVertex = new Vector2[cs.getVertexCount()];