Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 / J2ME / Re: How paint sprites in MIDP2 ? on: 2002-12-04 17:35:55
Hmm... didn't do my homework well i guess, just discovered that the pushpuzzle example IS actually created with MIDP2 using all of its fancy features. Thnx tho.
2  Java Game APIs & Engines / J2ME / Re: How paint sprites in MIDP2 ? on: 2002-12-04 15:53:50
Thank you for your explanation!

Thruth is I've just started using MIDP a few weeks ago. And I'm not much of an experienced java-programmer.

The JavaDocs say "protected GameCanvas(boolean suppressKeyEvents) Creates a new instance of a GameCanvas. A new buffer is also created for the GameCanvas and is initially filled with white pixels."

But I've tried to use a GameCanvas by defining public class MyCanvas extends GameCanvas { ... } and doing MyCanvas myCanvas = new MyCanvas(false); or just by doing GameCanvas myCanvas = new GameCanvas(false); . All of this didn't work, probable reasen is that GameCanvas is an abstract class and cannot be instantiated, or am I wrong here? Then how can I invoke GameCanvas' constructor as told in the JavaDocs?!  Huh

So I figured I can use GameCanvas by importing* in my class MyCanvas which extends Canvas. And then just invoking GameCanvas' methods. Plz correct me if I'm wrong (I'm still new to java).

Unfortunately the game examples that came with the MIDP2 package are written in MIDP1.
More or less, I'm desperately looking for a plain code-sample which reflects the basics of creating a game with MIDP2 (i.e. creating a MIDlet, creating a GameCanvas, LayerManager, Layers and Sprites and displaying the sprites in a viewwindow by the LayerManager). The ones I found don't seem to work, or consist of small code-snippets without keeping track of the bigger picture.

HMM.. as a java-rookie I'm really lost here aint I?  :-/

3  Java Game APIs & Engines / J2ME / How paint sprites in MIDP2 ? on: 2002-12-04 12:33:00
Hi, I'm really stuck here and any help is much appreciated! With the recently released MIDP2 I've created a layerManager and appended a sprite to it. But I can't manage to display the sprite. This is the code:

Image theImage;
Sprite theSprite;..

void someMethod() {
      try {
               LayerManager lm = new LayerManager();
               theImage = Image.createImage("/images/someImage.png");
               theSprite = new Sprite(theImage, (theImage.getWidth()/2), (theImage.getHeight()/2));
               lm.append( theSprite );               lm.setViewWindow( 0, 0, 96, 100 );
               theSprite.paint (graphicObject);
      } catch ( ex) {

In this code-snippet, what should the graphicObject be onto which the sprite is to be painted? Any examples?

I also tried creating a public class "TheSprite" extending Sprite and defining a method paint() in it. But the paint-method of Sprite cannot be overrided and a constructor cannot be resolved.

Please help!
Pages: [1]
EgonOlsen (79 views)
2018-06-10 19:43:48

EgonOlsen (59 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (261 views)
2018-05-13 18:23:11

nelsongames (160 views)
2018-04-24 18:15:36

nelsongames (158 views)
2018-04-24 18:14:32

ivj94 (902 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (813 views)
2018-03-24 14:43:53

Solater (177 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!