Closed Stef569 closed 12 years ago
Would it be useful to add ResourceManager.setReturnCopies(Boolean)
This would make the Resource manager return a shallow copy when you request an image or animation using the getter. It's a shallow copy because the image texture is not copied.
not needed for now
When you retrieve the same image from the resourcemanager and rotate 1 of them, they are all rotated!
for example:
Image a = ResourceManager.getImage("star"); Entity starA = new Star(50, 50 ,a) Image b = ResourceManager.getImage("star"); Entity starB = new Star(100, 150, b)
starA.setAngle(50);
starB is also rotated, since they share the same image instance.
ResourceManager.getImage and getAnimation could return a copy...
image.copy() and animation.copy()
or
Entity could create a copy when an image or animation is set (using the setGraphic or addAnimation methods)
additional problem is that BigImage does not support copy()