| Reply | « Previous Thread | Next Thread » |
|
Hi,
I have a simple menu that contains an image in the background: public class Menus extends Canvas implements Runnable{ public Menus(){ try { splash = Image.createImage("/splash.png"); } catch (IOException e) {e.printStackTrace();} setFullScreenMode(true); screenW = getWidth(); screenH = getHeight(); new Thread(this).start(); } protected void paint(Graphics g) { g.fillRect(0,0,screenW, screenH); // paint splash image g.drawImage(splash, screenW/2, screenH/2, Graphics.HCENTER|Graphics.VCENTER); ...etc etc } Now, on the default WTK 2.0 emulator this draws a black fill with my splash image nicely centered. But on the Nokia Series 60 2.0 emulator and also on my Nokia 6600, it draws it quite wrong. The fillrect does not fill the screen all the way to the bottom, and the splash image gets centered CORRECTLY in the HORIZONTAL, but is painted too high up in the VERTICAL. Is anyone aware of an issue with MIDP 2.0 method setFullScreenMode(true) ? does it not properly change the values of getWidth() and getHeight() ? thanks in advance, DK |
|
I don't know if this will help or not, because I haven't tried it on a 6600. But from my experience working with another MIDP 2.0 device, I noticed that the effects of setFullScreenMode() didn't start until after the Canvas was displayed. So after calling setFullScreenMode(), unless I waited for the next time the Canvas was refreshed, getWidth() and getHeight() returned values that were correct for a regular Canvas (not full-screen).
shmoove |
|
It happens to me too. But I´m not getting the right values even after a serviceRepaints( ). I can´t believe how bad is the J2ME implementation of the 6600. Porting a game from a 3650 it´s being a hell!
|
|
Actually I think this is related to a known issue with Series 60 phones in general (MIDP 1.0 or 2.0): getHeight() in full screen mode returns 144 instead of 208 (ie, the height of a normal canvas and not a full screen one). You need to hard-code the height.
shmoove |
|
wow, u serious? what a screw up.
I'll give that a try. thanks for the info!! david |
|
I didn´t have problems using the getHeight( ) and getWidth( ) methods in a 3650 and a 7650. That worked ok too with a series 40 phone. The problem is the damn 6600. Now that I fixed that the hard way (coding the values manually), I´m facing a worse problem. My MIDlet stopped detecting simultaneous key strokes. In fact it´s really extrange, the first time you play it does. But when you´ve been killed, and from that moment on an on, it stops working correctly.
I´m sure the MIDP 2.0 Canvas in Fullscreen implemented by the 6600 (with the old firmware) is using actually the Nokia UI API FullCanvas. I was using its constants to detect keystrokes and they were working with the 2.0 Canvas (but with the problem I mentioned above, not simultaneous keystrokes!). By the way, How can I update my J2ME firmware?. I´ll be posting a success story with the method drawImage and 6600. I´m learning a lot of the differences between models the hard way!! Thank you! |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|