Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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 18: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 16: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 ...lcdui.game.* 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 13: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:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
..
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 (java.io.IOException 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]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (22 views)
2014-07-24 01:59:36

Riven (21 views)
2014-07-23 21:16:32

Riven (17 views)
2014-07-23 21:07:15

Riven (20 views)
2014-07-23 20:56:16

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (53 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!