Java-Gaming.org
Java4K - to go         Javadoc:
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, peek at the official java tutorials or join us at irc #jgo.
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Weird rendering glitch  (Read 760 times)
0 Members and 1 Guest are viewing this topic.
Offline Jesse_Attard

JGO n00b
*

Posts: 15



« on: 2010-03-19 10:48:17 »

Hello,

One of my customers is experiencing a very strange problem when trying to access my game.  It's a Java Applet.  Just to be clear - this is the applet loading screen.  It does it when displaying the game too.  He says it's happening in all 3 browsers (ie, firefox, chrome).  Given that it's happening on the applet load screen I feel like the HTML must be the culprit, but to be honest I'm completely stumped here.

Here's a screenshot:


Here's how it's supposed to look:


Here's another example of the login screen (this is in-game code)



and how it's supposed to look:



Ignore the debug info - was just some stuff I printed to help debug the problem.

Anyone seen this before or have any idea what's going on here?  Most of my customers have no problem.  Website is www.immortal-empire.com
Offline Dathgale

JGO n00b
*

Posts: 6



« Reply #1 on: 2010-03-19 11:55:33 »

It's probably a browser problem. I would ask your customers what browser they're using if I were you. It looks like the applet is not being repainted after it is invalidated. Calling the applet's repaint() method after it loads might fix the login screen. As for the loading screen, consider using this kind of loading screen instead.
Offline Wildern

Full Member
**

Posts: 140



« Reply #2 on: 2010-03-19 16:19:24 »

Your load screen appears to just be an animated gif
http://www.immortal-empire.com/ie_loadscreen.gif
How are you displaying it?
Games published by our own members! Go get 'em!
Offline Jesse_Attard

JGO n00b
*

Posts: 15



« Reply #3 on: 2010-03-19 22:05:54 »

Yeah the browsers are IE, Mozilla, and Chrome.  All 3 it's doing this on his machine.  I've tried all three locally and they all work fine for me.

The applet calls repaint() on the Canvas every frame.  ie. there is a main thread that runs the game and calls the repaint method every X milliseconds.  I add the main Canvas to the JApplet's ContentPane on applet initialization. I can try calling repaint() on the Applet itself... will let you know how that goes.

For the load screen (which I'm less concerned about if the game ends up working fine) the HTML is as follows:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
<html>
<title>Immortal Empire</title>
<link rel="stylesheet" href="iempire.css" type="text/css">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<body>
<TABLE WIDTH=100% border=0 cellpadding=0 cellspacing=0>
<TR ALIGN=CENTER HEIGHT=80%>
<TD ALIGN=CENTER VALIGN=CENTER>
<BR><BR>
<applet code=Main.IsoGame.class width="800" height="600">
<param name="boxbgcolor" value="#000000">
<param name="boxfgcolor" value="#000000">
<param name="progresscolor" value="#9B5000">
<param name="boxborder" value="false">
<param name="image" value="ie_loadscreen.gif">
<param name="cache_archive" value="IsoGame.jar,IsoImages_interface.jar,IsoImages_game.jar,IsoSounds_interface.jar,IsoSounds_game.jar,IsoMusic_bossbattle.jar,IsoMusic_cinematic_standard.jar,IsoMusic_cinematic_vuldreth.jar,IsoMusic_desert.jar,IsoMusic_dialog_dazo.jar,IsoMusic_dialog_elder.jar,IsoMusic_dialog_maielle.jar,IsoMusic_grasslands.jar,IsoMusic_menu_0.jar,IsoMusic_menu_1.jar,IsoMusic_volcanic.jar,IsoLib_jogg.jar,IsoLib_jorbis.jar,IsoLib_tritonius.jar,IsoLib_vorbis.jar">
<param name="cache_option" value="Plugin">
<param name="cache_version" value="0.0.3.4,0.0.1.D,0.0.1.C,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8,0.0.1.8">
You cannot play this game because you do not have Java installed.  Java is a free download, please acquire it from <A HREF="http://www.java.com" target="_blank">http://www.java.com</A>.
</applet>
</TD>
</TR>
</TABLE>
</body>
</html>


It took me a while to settle on this type of deployment since it handles JAR caching and JAR indexing correctly in all browsers without needing javascript. I don't use JNLP - but maybe I should?
Offline pjt33

JGO Strike Force
***

Posts: 890
Medals: 17



« Reply #4 on: 2010-03-20 05:22:40 »

Do you hang on to the Graphics object from the paint/paintComponent call? That can cause interesting problems on Windows.
Offline Jesse_Attard

JGO n00b
*

Posts: 15



« Reply #5 on: 2010-03-20 12:49:40 »

I store the Graphics object of the backbuffer as a member variable of the main frame. It's just an image I use for double buffering to prevent flickering.  I don't store the Graphics object of the paint() method that's passed as a parameter. 
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.09 seconds with 20 queries.