Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with Cinematics [Possibly coming from libgdx directly] #74

Open
FrancoisDuchene opened this issue Apr 13, 2020 · 0 comments
Open

Bug with Cinematics [Possibly coming from libgdx directly] #74

FrancoisDuchene opened this issue Apr 13, 2020 · 0 comments
Labels
bug Something isn't working wontfix This will not be worked on
Milestone

Comments

@FrancoisDuchene
Copy link
Collaborator

FrancoisDuchene commented Apr 13, 2020

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.

@FrancoisDuchene FrancoisDuchene added bug Something isn't working wontfix This will not be worked on labels Apr 13, 2020
@FrancoisDuchene FrancoisDuchene added this to the future milestone Apr 13, 2020
@FrancoisDuchene FrancoisDuchene changed the title Bug with Cinnematics [Possibly coming from libgdx directly] Bug with Cinematics [Possibly coming from libgdx directly] Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant