You Are Here:

Community: Developer Discussion Boards

#1 Old MIDP 2.0 setFullScreenMode - image not centering properly - 2004-01-19, 02:59

Join Date: Mar 2003
Posts: 11
dkainer
Offline
Registered User
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
Reply With Quote

#2 Old 2004-01-19, 08:30

Join Date: Mar 2003
Posts: 2,280
Location: Israel
shmoove
Offline
Forum Nokia Champion
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
Reply With Quote

#3 Old 2004-06-28, 21:23

Join Date: Aug 2003
Posts: 12
gutilin
Offline
Registered User
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!
Reply With Quote

#4 Old 2004-06-29, 08:52

Join Date: Mar 2003
Posts: 2,280
Location: Israel
shmoove
Offline
Forum Nokia Champion
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
Reply With Quote

#5 Old 2004-06-29, 08:54

Join Date: Mar 2003
Posts: 11
dkainer
Offline
Registered User
wow, u serious? what a screw up.

I'll give that a try. thanks for the info!!

david
Reply With Quote

#6 Old Simultaneous keystrokes and 6600 - 2004-06-29, 12:03

Join Date: Aug 2003
Posts: 12
gutilin
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ