-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Bug relative to development
Description
When we use several images to make Cinematics Screens, and that we interchange these images, it happen that some of the images aren't correctly displayed. Here is an example of code :
final Image house = new ImageBuilder().withTexture("game3/intro/Monde2Ecran1.png").build();
final Image inside = new ImageBuilder().withTexture("game3/intro/Monde2Ecran2.png").build();
final Image bubbleLeft = new ImageBuilder().withTexture("ImagesGadgets/Bulle1.png").build();
final Image bubbleLeft2 = new ImageBuilder().withTexture("ImagesGadgets/Bulle1.png").build();
final Image mireille = new ImageBuilder().withTexture("MireilleImages/Mireille.png").build();
final Image[][] images = new Image[][] {
{
house,
mireille,
bubbleLeft // Everything is okay
},
{
house,
mireille,
bubbleLeft // Here too
},
{
inside,
mireille,
bubbleLeft // Here, only the "inside" image is displayed, neither "mireille" and "bubbleLeft" are
},
{
inside,
mireille,
bubbleLeft2 // Here, "inside" and "bubbleLeft2" are displayed, Mireille not
}
};Cause
I debugged the code of Cinematic Screen, but i see no place where this could happen. To display or not images, we don't use internally a spritebatch but a stage, the images are simply set visible to true or false to decide whether they are displayed or not. Thus, this imply that the problem comes most likely from Stage class, which we cannot really fix.
Solution
As a partial solution, we just have to create multiple Images objects with the same texture instead of reusing the same image multiple times. This will obfuscate the code more but at least it works until this issue is taken care of.