digital-thinking / libgdx-transitions Goto Github PK
View Code? Open in Web Editor NEWlibgdx screen transitions/fading
License: Apache License 2.0
libgdx screen transitions/fading
License: Apache License 2.0
While the transition is running, the font of the second screen is not shown correctly. There is only some default font, but not the font from my skin. After the transition is finished, everything looks normal again. The same happens with the alpha level: During the transition, the alpha level of textures is always 100%.
However, this only happens to the second screen.
Maybe I am doing something wrong?
And thank you for publishing the library, its great!
Edit: Oh now it seems to work properly. In the transition class, I removed the following lines:
Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
Hi,
thank you for publishing this library, saved me quite some time.
I noticed while testing, in FadingGame.java, Line 95:
There is a missing screen.render()
call for the case that the animation is finished.
So the current behaviour is this:
Which causes a single blank frame to be renderer, causing 'flickering'.
Suggested fix:
Add screen.render()
in FadingGame.java Line 95.
Again, thank you for your work!
I noticed that if a screen contains any semi transparent sprite (i.e. having a color applied with alpha < 1) then visual artifacts will be produced while transitioning.
To reproduce this issue, you can slightly modify your TestCase, adding a line:
actor.setColor(new Color(1f, 1f, 1f, 0.5f));
somewhere inside SimpleScreen's constructor and changing another line to this:
batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
inside the draw method of said actor.
I noticed that you cleverly avoided to use color.a when setting the color to the batch, but this is not a solution because it disables semi transparency for a single sprite. Moreover, Image and many other standard classes extending Actor do use color.a in their draw methods, so using any of these classes would make you prone to get the artifacts.
If I make my main class extend FadingGame instead of Game, I get a NullPointerException in new Spritebatch() while calling the superconstructor.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.