Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Transparent PNGs in MIDP1.0  (Read 2905 times)
0 Members and 1 Guest are viewing this topic.
Offline markjc

Innocent Bystander




Java games rock!


« Posted 2003-05-16 14:04:20 »

Has anyone successfully used transparent images on a MIDP1.0 setup?  I've tried it using the J2ME Wireless Toolkit 1.0.4_01, but to no avail.  I don't know whether it's not supported (doc's say it may or may not be, depending on the device) or if I've messed up creating the PNG file.  My main interest is getting something going on the Palm emulator.

Cheers,
Mark
Offline Abuse

JGO Coder


Medals: 10


falling into the abyss of reality


« Reply #1 - Posted 2003-05-16 16:07:31 »

I don't think any of Suns emulators support transparency, however most emulators from phone manufacturers (and there real phone counterparts) do support transparency.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline daybyter

Senior Newbie




Java games rock!


« Reply #2 - Posted 2003-05-16 16:20:42 »

I added
=====================
# Enable transparent PNGs for sprites.
enablePNGtransparency=true
======================
to the properties file of my testing device to activate it here.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline shareme

Junior Member




Java games rock!


« Reply #3 - Posted 2003-05-18 00:30:42 »

Quote
I added
=====================
# Enable transparent PNGs for sprites.
enablePNGtransparency=true
======================
to the properties file of my testing device to activate it here.



only wtk2.0  MIDP 2.0 supports png transparencies..

to get via MIDP 1.0 you have to use your cell vendors api..

Offline daybyter

Senior Newbie




Java games rock!


« Reply #4 - Posted 2003-05-18 08:39:57 »

I added the line to my WTK 1.0.4 under Linux to make it work. I did not download WTK 2 yet, since it requires JDK 1.4 and I have only 1.3.
Offline shareme

Junior Member




Java games rock!


« Reply #5 - Posted 2003-05-18 12:46:09 »

Quote
I added the line to my WTK 1.0.4 under Linux to make it work. I did not download WTK 2 yet, since it requires JDK 1.4 and I have only 1.3.



it still will not work wtk 1.04 is MIDP 1.0!

Jdk1.4 is aviable for linux through both blackdown and IBM-Jikes

You can only get trasnparency of PNG on MIDP 1.0 by using the closed source apis of the target device vendor.. for example to get transparency of png on nokia phone syou have to use Nokia's api..


Offline daybyter

Senior Newbie




Java games rock!


« Reply #6 - Posted 2003-05-18 14:55:10 »

What can I say. After adding the line here, my game had transparent sprites with WTK 1.0.4. I know for sure , since I especially had to add the line to make our current game work (we need transparency in our sprites). We don't use any vendor specific APIs yet.
Offline the2bears

Senior Member


Projects: 2


Little Bear: Code Fu!


« Reply #7 - Posted 2003-05-18 15:44:39 »

" it still will not work wtk 1.04 is MIDP 1.0!"

Easy there:)

We use WTK1.04, on purpse, because *yes*, it's MIDP 1.0 and png transparency works.  It's supported on many MIDP 1.0 phones we have tried it on as well, without using any manufacturer or provider apis.

Bill

the2bears - the indie shmup blog
Offline davidaprice

Junior Member





« Reply #8 - Posted 2003-05-18 19:34:42 »

Transparent PNG support is optional in MIDP 1.0, and mandatory in MIDP 2.0. Most MIDP 1.0 phones support it (e.g. all of Nokia's), and WTK 1.0.4 (for MIDP 1.0) supports it if you set that enablePNGtransparency setting daybyter mentions.
Offline shareme

Junior Member




Java games rock!


« Reply #9 - Posted 2003-05-19 15:57:41 »

Quote
Transparent PNG support is optional in MIDP 1.0, and mandatory in MIDP 2.0. Most MIDP 1.0 phones support it (e.g. all of Nokia's), and WTK 1.0.4 (for MIDP 1.0) supports it if you set that enablePNGtransparency setting daybyter mentions.



that only takes care of the emualtor..you have to use a closed source api from a device vendor to enable on the actual device!

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davidaprice

Junior Member





« Reply #10 - Posted 2003-05-19 19:44:03 »

It depends on the device, but in most cases (e.g. all Nokia MIDP 1.0 phones) PNG transparency is supported through the standard MIDP API. You don't need any proprietary APIs to get transparent sprites.

The methods in question are in class:
   javax.microedition.lcdui.Image
they are:
   static Image createImage(String)
   static Image createImage(byte[], int, int)
The first takes the name of a file in the MIDlet's JAR file (e.g. "/rocket.png", don't forget that "/"); the second uses data from a byte array.

See the JavaDocs for class Image, and read the section titled PNG Image Format. The second bullet point ends with "Color types that include alpha channel data are supported; however, the implementation may ignore all alpha channel information and treat all pixels as opaque." (My italics).

So, manufacturers can ignore the transparency information and create opaque Images from transparent PNGs, but they can also choose to interpret the transparency information and create transparent Images from transparent PNGs.

I'm not just talking theory here - I have personally written many MIDP 1.0 MIDlets with transparent sprites and run them successfully on several different Nokia MIDP 1.0 phones.
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #11 - Posted 2003-05-22 21:20:48 »

Yes, I can confirm this to be accurate. If you use the proper constructor - the vast majority of devices that DO support transparency (and not all of them do) will handle the transparency correctly. I haven't run across any recent (last 12 month) devices that didn't support transparency correctly, but some of the early MIDP devices seemed to have some problems with it.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline the2bears

Senior Member


Projects: 2


Little Bear: Code Fu!


« Reply #12 - Posted 2003-06-03 02:42:26 »

Quote
that only takes care of the emualtor..you have to use a closed source api from a device vendor to enable on the actual device!


I'll confirm with others... and what I tried to say above.  It's working on many 1.0 phones without special APIs!  All Nokias I've tried (3650, 7650, 7210) and the Motorola i95cl work well.  The Samsung A500 does not, which is a shame given that it has such a nice screen.

Bill

the2bears - the indie shmup blog
Offline eric_o_z

Senior Newbie




Java games rock!


« Reply #13 - Posted 2003-06-04 06:13:12 »

in midp1.0, png32 or png24 transparent is supported. In photoshop ImageReady7.0, create a transparent image, and save the image as png24 or png32 format, and transparent is supported. I have finish a game like this.

I love game program.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (18 views)
2014-04-15 18:08:23

BurntPizza (15 views)
2014-04-15 03:46:01

UprightPath (28 views)
2014-04-14 17:39:50

UprightPath (13 views)
2014-04-14 17:35:47

Porlus (29 views)
2014-04-14 15:48:38

tom_mai78101 (54 views)
2014-04-10 04:04:31

BurntPizza (111 views)
2014-04-08 23:06:04

tom_mai78101 (212 views)
2014-04-05 13:34:39

trollwarrior1 (181 views)
2014-04-04 12:06:45

CJLetsGame (187 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!