Jump to content

  • Log In with Google      Sign In   
  • Create Account

[java] What API to use for 2D game development?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 MarcusLM   Members   -  Reputation: 152

Like
Likes
Like

Posted 01 June 2000 - 02:16 AM

I love Java and I am wanting to experiment with some 2D game edevelopment. My question is what API is best to use for this?? Are people using Java2D for game dev?? Are there other API''s/Libraries out there good for this?? Any suggestions will be appreciated. Thanks. Marcus

Sponsor:

#2 ErikLong   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 June 2000 - 06:30 AM

Just Use The Regular Java Pain Methods.

public void paint(Graphics g)
{
g.drawString(X,Y,"");
g.drawOval(X,Y,Width,Height);
g.DrawRect(X,Y,Width,Height);
}

And So On...

#3 SteveMeister   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 June 2000 - 07:04 AM

Expanding on that, if you want to use Java2D, just cast your Graphics instance to Graphics2D, and you''re good to go:

public void paint(Graphics g)
{
Graphics2D g2d = (Graphics2D) g;
...
}

Java2D is really nice, you can do a lot with it. Also, if you subclass a JComponent as your main drawing area, you can get double buffering for free:

public class MyPanel extends JPanel
{
public MyPanel()
{
super();
setDoubleBuffered(true);
...
}

public void paint(Graphics g)
{
super.paint(g);

Graphics2D g2d = (Graphics2D) g;
...
/* paint stuff */
}
}

Here''s a very good Java2D tutorial on Sun''s Java website:

http://java.sun.com/docs/books/tutorial/2d/index.html


#4 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 01 June 2000 - 08:11 AM

You can also use OpenGL with Magician or some other interface. But hey, don''t underestimate normal Graphics, because you can do alot of things only with it.

Time comes, time goes and I only am.

#5 Jerry Lynn   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 June 2000 - 08:19 AM

And DirectX is an option, even if it''s not a very good option because:

1- The latest version of DirectX that provides Java bindings is DirectX 3.0 (They are now on 7)

2- Microsoft has stated they have no intention of supporting langauges other than VC++ and VB with DirectX.

3- Going over the COM interface that is available for Visual Basic in DirectX 7.0 is full of gotcha''s. You would also pretty much be on your own as very few individuals have tried this.



#6 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 02 June 2000 - 05:36 AM

I''m not sure about further implement of Dirext X for java because Sun and Microsoft made treaty which stops MS raping Java even more so their un platformintependent API is supposingly held, too.

Time comes, time goes and I only am.

#7 javanerd   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 June 2000 - 10:18 AM

If that is true, it sucks! Why are we being denied the choice? I mean I''ve been using pure Java quite happily alongside Microsoft Java in my GF4J library. It is merely the question of understanding what you are doing. You really can make code that runs under both MS Java VM with enhancements and normal Java VM without the bells and whistles.

If Microsoft''s DirectX support in their Java library is pulled out or left dying in the form it is today, it just makes it that much more difficult for us the more open minded game programmers.

But in a more larger scale this is just a thing you can expect to happen when two bone headed giants collide. And it makes me even more interested about what happens after Microsoft gets their videogame console XBox out and notices that they have a "leak" of profits when game programmers publish their games under Windows 2000 or Windows Millenium . Will they offer a DirectX+ version for the XBox or just keep the latest version of DirectX XBox exclusive for half a year at a time?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS