|
Post by gunblade on Sept 4, 2007 16:58:13 GMT -5
So anyways did as you said by both using
System.out.println("Just created SquareBox, is it null? " + (SquareBox == null) );
and
try{ SquareBox = Image.createImage("/squarebox.png"); }catch(Exception e){ System.out.println("Exception creating SquareBox! " + e.toString() ); e.printStackTrace(); }
now the try catch turned up nothing but using the top line I found out that the image seems to be null before it's even drawn.
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 16:59:30 GMT -5
Is it null immediately after creating it? Or does it dissapear somewhere after?
|
|
|
Post by gunblade on Sept 4, 2007 17:03:38 GMT -5
I pasted the line right where it starts running and tested it with a few other loaded pngs that previously had no problems, some tested as true including the squarebox.
while(running) { System.out.println ("Exception creating SquareBox! " + (SwapUp== null) );
that variable is another pic that use to work and now says that null is true. sqaurebox is the same
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 17:08:18 GMT -5
Hmm... What IDE are you using to build / test with? Maybe it just needs to be refreshed.
You wouldn't be able to post an entire class file would you? That may be helpful, but only if you are willing.
My best guess at the moment, is that an exception is happening in the middle of a function, and some of the initializations aren't being reached.
|
|
|
Post by gunblade on Sept 4, 2007 17:14:04 GMT -5
The reason i didn't post an entire file ... I (Adam) took out the code, since we don't need it here anymore...
Enjoy X-D
P.S Using netbeans at the moment.
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 17:22:26 GMT -5
I'm taking a look, It'll take me a few minutes to set up a new project here...
|
|
|
Post by gunblade on Sept 4, 2007 17:24:34 GMT -5
ah that won't run on it's own
|
|
|
Post by gunblade on Sept 4, 2007 17:27:07 GMT -5
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 17:31:22 GMT -5
thanks!
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 17:40:44 GMT -5
Here's the first problem, haven't got any farther yet...
ColourSelectCursor = Image.createImage ("/colourselectcursor.png");
This image isn't in the res folder.
Tried loading a different image and nothing else seems to go wrong, so that may be the only problem!
|
|
|
Post by gunblade on Sept 4, 2007 18:03:30 GMT -5
Your a legend and I love you... Though I never expected that to crash everything else afterwards
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 18:07:08 GMT -5
Yeah, one small problem, and WHAM! Nothing works properly. The exception that image caused made it skip the rest of the images. Ever played any of my games? I give em away for free with advertising. If you would like to try some out, they can most easily be found on my wap site (mobile only) at... attackgames.game-host.orgWhat type of game is this going to be?
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 18:09:05 GMT -5
Oh yeah, come back any time you want to discuss anything mobile, or if you ever want some more help. My message board is quite low-traffic.
|
|
|
Post by gunblade on Sept 4, 2007 18:09:36 GMT -5
military board game thingy. Working with a team and we'll see how it goes once it's done.
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 18:14:44 GMT -5
Gonna try to sell it? If you havn't really though about it yet, check out gamejump.com . They put advertising into the game, and you can make money giving it away for free. Just some food for thought...
|
|
|
Post by gunblade on Sept 4, 2007 18:57:58 GMT -5
Yeah but i'm not team leader I'm just designing the menu. Had it done but I had to redo a few things and thus image errors. I'll let the tram leader know about the site though Ah yes you also know any programs which can shrink png files into even smaller sizes?
|
|
|
Post by Adam Schmelzle on Sept 4, 2007 19:41:01 GMT -5
have a look around for a program called PNGcrush
|
|