Archived

This topic is now archived and is closed to further replies.

[java] Resizing images in J2ME

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I''m almost done with developing a J2ME version of Colourama (http://colourama.pt.vu), but I ran into a problem... to assure device-independence, I figured out some calculations to do when the game''s starting that fit the play area to the screen. This works really well for the drawing primitives, but I''m having problems with the background pictures that I added in the latest update of the PC version. I think that the game really looks cooler with them, but I''m not being able to resize them, so they''re limited to a single size... since J2ME seems to lack a g.drawImage(image,0,0,NEW_WIDTH,NEW_HEIGHT,this), is there anything I can do? I''m almost sure I''m missing something, cause Java is all about device-independence but, in this case, it''s totally dependent . Any thoughts? Pedro

Share this post


Link to post
Share on other sites
The simplest option may be just to distribute different images for each specific hardware... currently this is what we have to do for apps on java cellphones.

Share this post


Link to post
Share on other sites
Hmmm... but that''s not really pratical... there are already several different device types out there and there''ll be a lot more soon... packing images for each one is (or will be) almost impossible. Or do you have some pre-specified resolutions (for example, forcing the game to be 90*90 if the cellphone''s resolution is between 90*90 and 120*120)?

By the way, I''ve just created a small website for my games... the site''s pretty simple, but it works as a "link" between the stuff I produce. I''m using it only for the games I currently have on the web, so there isn''t much up yet . The URL''s http://pedroamaro.pt.vu (if anyone''s interested )

Pedro

Share this post


Link to post
Share on other sites
I thought you were just talking about background images. I don''t actually do this myself but the guy that does says they have different sized background images for different phones. I think for the actual game they just make it for the smallest common size ie. 90x90 so your method is perhaps more advanced. According to him, I wouldn''t trust in ''device-independence'' in this case at all. The differences between emulators and the real phone can give you some surprises too

btw is that terragen?

Share this post


Link to post
Share on other sites
The graphics on Colourama? Bryce 5 (first try on using that program... it''s really easy to use, although it''s not the most complete program ever made ). Gets 7/10 on my ratings

Pedro

Share this post


Link to post
Share on other sites