Author Topic: [Java] Insanely fast gif splash  (Read 1640 times)

0 Members and 1 Guest are viewing this topic.

Offline Stybar

  • Master Member
  • ********
  • Posts: 8262
  • NO DATA AVAILABLE
[Java] Insanely fast gif splash
« on: March 14, 2012, 08:20 »
So I have to create a game of Uno in Java. Game works decently, won't bother you with the game itself, but the splashscreen is bugging me... I have a gif I want to show that lasts for about 3 seconds, but the problem is the gif flashes insanely fast. I mean epileptic attack inducing fast.
Any idea if this is a problem with Java itself, or did I mess something up in the code itself?

The code:   here.


and the gif:

Offline Impulse

  • Global Moderator
  • Master Member
  • ********
  • Posts: 7849
  • LozL
Re: [Java] Insanely fast gif splash
« Reply #1 on: March 14, 2012, 08:30 »
I am no expert, but I suspect that your code wants to instantly load all the image files inside the .gif file instantly resulting into all of them being loaded simultaneously.

Offline Stybar

  • Master Member
  • ********
  • Posts: 8262
  • NO DATA AVAILABLE
Re: [Java] Insanely fast gif splash
« Reply #2 on: March 14, 2012, 08:42 »
^no, it flashes alright, but it flashes as if it wants to display the entire gif 5 times in one second.

Offline Impulse

  • Global Moderator
  • Master Member
  • ********
  • Posts: 7849
  • LozL
Re: [Java] Insanely fast gif splash
« Reply #3 on: March 14, 2012, 08:45 »
Have you tried increasing the delay in the .gif itself?

Online Mave

  • TMS Founder
  • Administrator
  • Godfather
  • *********
  • Posts: 119377
Re: [Java] Insanely fast gif splash
« Reply #4 on: March 14, 2012, 10:36 »
Stybar, I tried with Impulse said and added 100 milliseconds delay to every frame.
Could you update the gif to http://themavesite.com/UNO/splash.gif and re-check?

Offline GPow69

  • consololol ಠ_ಠ
  • Global Moderator
  • Ultimate Member
  • ********
  • Posts: 18872
  • EDM for life ♥
Re: [Java] Insanely fast gif splash
« Reply #5 on: March 15, 2012, 10:25 »
How many times does splash() get called? Once I assume?

Online Mave

  • TMS Founder
  • Administrator
  • Godfather
  • *********
  • Posts: 119377
Re: [Java] Insanely fast gif splash
« Reply #6 on: March 15, 2012, 11:08 »
How many times does splash() get called? Once I assume?

Once and it's fixed now ::3:
I had to put a higher delay in photoshop on the frames, since Java loaded them instantly.

Offline GPow69

  • consololol ಠ_ಠ
  • Global Moderator
  • Ultimate Member
  • ********
  • Posts: 18872
  • EDM for life ♥
Re: [Java] Insanely fast gif splash
« Reply #7 on: March 16, 2012, 01:24 »
How much delay was on the frames initially?

Online Mave

  • TMS Founder
  • Administrator
  • Godfather
  • *********
  • Posts: 119377
Re: [Java] Insanely fast gif splash
« Reply #8 on: March 16, 2012, 05:14 »
How much delay was on the frames initially?

None, though in a browser it looked okay (it did have some time for each frame automatically? :/)

Offline GPow69

  • consololol ಠ_ಠ
  • Global Moderator
  • Ultimate Member
  • ********
  • Posts: 18872
  • EDM for life ♥
Re: [Java] Insanely fast gif splash
« Reply #9 on: March 16, 2012, 11:22 »
Browsers have a throttle on the speed of .gif frames usually :p

Online Mave

  • TMS Founder
  • Administrator
  • Godfather
  • *********
  • Posts: 119377
Re: [Java] Insanely fast gif splash
« Reply #10 on: March 17, 2012, 08:59 »
Browsers have a throttle on the speed of .gif frames usually :p

That explains :P