Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Android / Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget on: 2010-03-30 05:34:31
Have you tried using SoftReferences for referencing the bitmaps?

This way the GC should clear out references  before you run out of memory.
Combined with a lazy loading mechanism this will give you more memory to work with, at the expense of more IO and decoding ofcourse.  Smiley
2  Java Game APIs & Engines / Java 2D / Re: Horrendous Performance in a Simple Java2D App on: 2009-04-22 05:44:13
If you're running on linux with intel graphics and don't have 'UseFBDev' set to 'true' in xorg.conf this may help:


(add it as an addition argument on the commandline, or as VM argument in your IDE).

Also have a look at this :
3  Game Development / Newbie & Debugging Questions / Re: NotClassDefFoundError on: 2009-01-31 14:12:57
The JAVA_HOME environment variable should only contain a single path like "c:\java". If you want to start Tomcat (an interesting choice of game engine btw Smiley ) you should use the provided startup/shutdown scripts in the  c:\tomcat\bin folder.
4  Game Development / Newbie & Debugging Questions / Re: Why is my JPanel too big? on: 2009-01-29 08:50:24
It depends on what layout manager you're using on the component your adding your panel to.
See this:

The quick fix might actually be to use
as well. If that does not work you can try to set the layout manager on the container of your panel to null and then use setLocation(..) and setSize(..) to place the component manually. It won't resize with the window through.
See this: [url][url]
5  Game Development / Newbie & Debugging Questions / Re: JCheckBoxMenuItem question on: 2009-01-24 14:01:55
And don't forget to group them in a ButtonGroup to make them mutually exclusive.
6  Games Center / 4K Game Competition - 2009 / Fortress4K on: 2009-01-04 13:00:39
A Fort Apocalypse inspired game:

Trapped in a underground fortress, 4 scientists are waiting to be rescued by you, the Armies most skilled helicopter pilot. If all the blockades, laser cannons and misile turrets are not enough, the swift rescue of the scientists is also hindered by the complex layout of the fortress itself, requiring impressive navigational skills. Fortunately you have your SX-4096 helicopter to aid you in your quest.

Rescue the 4 scientists scattered around the fortress.
Use the radar (bottom right) to find them.
The game is over when all your helicopters are lost.

Use W, S, A and D keys move the helicopter.
Use SPACE to fire the onboard cannon.

I hope you like it  Wink
7  Java Game APIs & Engines / Java 2D / Re: Graphics2D transformation on: 2007-03-07 10:34:28
The reason that the label in heightened renders wrong is because all the coordinates are
multiplied by 2 as well :-) So to compensate you need to translate half the height up, then
scale, then render the component internals, scale back and translate back. The last two are
needed if you want to properly render borders and other decorators of the swing component.

      protected void paintComponent(Graphics g) {
        Graphics2D g2d= (Graphics2D) g;
        double scaleX= widened? 2 : 1;
        double scaleY = heightened? 2 : 1;
        if (heightened) g2d.translate(0,-getHeight()/2);
        g2d.scale(scaleX, scaleY);
        g2d.scale(1/scaleX, 1/scaleY);      
        if (heightened) g2d.translate(0,getHeight()/2);

This is quite a hackish solution on top of a JLabel (but, it works! :-)
Maybe a better solution is do your own custom rendering using a JPanel or JComponent.

Have fun !


8  Game Development / Newbie & Debugging Questions / Re: Question regarding StringUtils.bytesToHex() on: 2006-11-29 14:17:40

Mmm. I cant seem to find the class StringUtils and the method bytesToHex in the JDK docs.

If I look at your code I think you're converting a byte/char array into a hexadecimal string minus
the last 4 bytes/chars. One byte/char would correspond to 2 digits in the resulting string.

So limiting the length to 8 would only work if the original userId would be exactly 8 bytes
-> abcdefgh minus 4 -> abcd -> 61626364
If it would be, lets say 6 bytes the result would be :
-> abcdef minus 4 -> ab -> 6162
Oops :-)

If you would want to limit the length of an array why not use System.arraycopy :
        char[] src="42:life universe everything".toCharArray();
        char[] dst=new char[8];
        myId=new String(dst);


       myId=new String(userId,0,userId.length>8?8:userId.length);

Good luck !

9  Java Game APIs & Engines / Java 2D / Re: Outlined text and outlineColor and inner fillColor? on: 2006-04-16 09:06:59
To get nicely rendered small outlined text you can also tell the Graphics2D object to
scale all your rendering operations using the scale() method. 

The second thing you can try is to turn on the rendering hint for fractional metrics


and tell your font render context that you're using these as well :

  FontRenderContext frc = new FontRenderContext(null,true,true);

Ofcourse you must change the thickness of the outline accordingly :

  BasicStroke wideStroke = new BasicStroke(0.5f);  // or something

10  Java Game APIs & Engines / Java 2D / Re: Outlined text and outlineColor and inner fillColor? on: 2006-04-15 14:29:38
Hi Whome,

If you already have the shape, why not use it again with g2D.fill(outline) ? 
Solves the problem :-) Apparently drawString calculates a little different  :-)

      Shape outline = tl.getOutline(textAt);
      BasicStroke wideStroke = new BasicStroke(2);

For your second question, you can create scratch instances of the Graphics object using the create() method,
as you will modify these the original Graphics object will not be changed :-)

    Graphics2D sub=(Graphics2D)g2D.create();
    try {
      sayWorld(g2D, 100, 100, true);
    } finally {
    try {
      sayWorld(g2D, 100, 160, false);
    } finally {

Have Fun,

11  Java Game APIs & Engines / Java 2D / Re: bufferedImage Rotation Problem on: 2006-04-03 07:16:59
I ran your code with a transparent background png image of my own but could not  reproduce the
swirls. Maybe its not the code that is at fault here ?

The only thing I see that could corrupt the image is invoking the rotateImage method multiple
times in a row, as it overwrites the source image with the new rotated image which is then
used again as the source image for the next rotation. As an rotated image is never as good
as its original (pixels you know :-) if rotated long enough it will result in something pretty strange Smiley

Good luck,

12  Java Game APIs & Engines / Java 2D / Re: Custom Look and Feel on: 2006-04-03 06:24:50
I am sorry ENC, there is no such tool that I know of...

.. but please correct me if i'm wrong :-)
13  Java Game APIs & Engines / Java 2D / Re: Custom Look and Feel on: 2006-03-26 15:14:42

I've good news and bad news for you. You cannot have a custom look and feel on AWT components. Why ? Because they
are actually native platform dependent components with a wrapper around them to make them sort of identical.

You can have a custom look and feel on Swing components (javax.swing.* package).
To do this is not a trivial task but i'll give you some pointers :   - an articicle on implementing custom L&F (high-level)  - a whole chapter on the subject.

If you really don't want to use Swing, there is only one alternative and that is extend the java.awt.Panel class and do all the event
handing and repainting yourself...

Have fun designing !

14  Java Game APIs & Engines / Java 2D / Re: What does sun.awt.ScreenUpdater do? on: 2006-03-25 11:51:10
Hi  Clemens,

Unfortunately there is no documentation available for these classes (as far as i know :-) its a non-public api.

I just had a look at the decompiled classes of jdk 1.1.5 and my guess is that the purpose of ScreenUpdater
UpdateClient and ScreenUpdaterEntry is a time scheduling queue for calls to the UpdateClient interface.

Typically the UpdateClient interface is implemented by the ComponentPeers (the platform specific instances
of the components) and its purpose is to do a repaint. (native pTriggerRepaint())

So it intended purpose is a repaint mechanism. What is in a name :-) The question now is why did they use this
non public api ? Did they intend to trigger repaints, in that case you should be able to use a plain ordinary
repaint().  However, as it is a generic time scheduler, you could also use it for something different.. and there
is this evil object parameter that you can pass around to do strange things with... . .

Good luck :-)

15  Games Center / 4K Game Competition - 2006 / Re: And the winner is ... on: 2006-03-13 19:38:35
 Cheesy Noooh. I ended up at #36 with Jyruss4k, which is kinda nice for something i decided 'just to have a go at' Smiley
16  Games Center / 4K Game Competition - 2006 / Re: And the winner is ... on: 2006-03-13 17:43:56
Thanks for organizing this great little compo !

I had lotsa fun (both playing and participating :-)

I'll try hard to do better next year !!

Pages: [1]
BurntPizza (14 views)
2015-10-07 02:11:23

KaiHH (13 views)
2015-10-06 20:22:20

KaiHH (11 views)
2015-10-06 19:41:59

BurntPizza (23 views)
2015-10-06 19:04:48

basil_ (44 views)
2015-09-30 17:04:40

shadowstryker (22 views)
2015-09-29 15:55:06

TheSpaceHedgehog (28 views)
2015-09-29 01:58:48

GamerC4 (54 views)
2015-09-24 21:10:38

GamerC4 (71 views)
2015-09-24 21:09:48

htuy (28 views)
2015-09-24 04:57:24
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!