Forums Register Login

Question on the images used in Sprite class listing from SCMAD Exam Guide book.

+Pie Number of slices to send: Send
Hi,

I'm trying to execute the Listing 6.5 and 6.6 (MIDlet) from the SCMAD Exam Guide book. It is for a GameCanvas to display an animated Sprite according to its frame sequence.

In the following piece of code, I'm not clear what I should use for the man1.png. I created a small PNG file of a stick man in Paint. But am getting I/O access error. Complete listing for this exmaple is found in http://www.scmadbook.com/index.php/Code#Sprite_Sequence_MIDlet_.28Listing_6.6.29.

What is expected in the PNG file. Please help. I'm executing this in NetBeans v6.5 using the default emulator.



Regards,
+Pie Number of slices to send: Send
Hi Jane,

We'll post the images referred in the book shortly on the website. Meanwhile, you should be able to use any PNG file (30px wide by 60px long). Make sure that it is in the location referred in the code (under the "res" folder).
+Pie Number of slices to send: Send
Hi Sathya,

Thanks for your reply. The I/O access error was indeed due to a location and a filename issue. I was using lowercase .png; but image was stored under as .PNG. (duh...).

I created 4 pictures of 30 X 60 dimension and pasted them together using Paint. Was able to successfully run the program now, so that the four pictures were being displayed one after the other.

Thanks!,
+Pie Number of slices to send: Send
 

Jane Joseph wrote:
I created 4 pictures of 30 X 60 dimension and pasted them together using Paint. Was able to successfully run the program now, so that the four pictures were being displayed one after the other.


Hi Jane,
Please see below for the original image:


You can get it from here as well.

Thanks,
Ko Ko
+Pie Number of slices to send: Send
Hi Ko Ko,

Executed the program with the original image that you sent. Was very happy to see the dancing man finally! Thank you very much.
(Only a slight change with regards to the image dimensions were required viz. sprite = new Sprite(manImage, 21, 43);)

Regards,
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1876 times.
Similar Threads
I survive the real exam this morning ;-)
Objectives for the SCMAD exam are here!!
sprite question
UTFDataFormatException
Why does a char value also have an integer value?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:07:01.