get_group() returns bindtexture and vertexinstructions, how to pick just the latter
https://stackoverflow.com/questions/39476837/return-from-canvas-get-group-call-in-kivy
I have a big bunch of Rectangles added to my canvas and I put a parameter of group="tiles" on them. Then I try to change their position by doing this:
for tile in self.canvas.get_group("tiles"):
tile.pos = new_pos
But it returns an error because the instruction group gives two types of instructions: "bind texture" and "vertex instructions" you can see better from the link I put above. But the response to the link's questioner only says that yeah, its safe to ignore the bind texture instructions (which hold the "source" part of the rectangle). But it doesn't say HOW I can only pick the ones that are vertex instructions. So the error I get when I try to change the .pos is because it tries to change .pos of a bind texture which doesnt have a .pos.
EDIT:
I solved it, but the solution is kinda weird (see comments). So if anyone has something to say about all this please do.
Posted Dec 6, 2018, 1:34 AM UTC · edited