Working with one multiple-framed imag file

All your problems with Audio, Video and Images.

Working with one multiple-framed imag file

Postby Ingersol » Sat Dec 06, 2008 4:08 pm

Standart de-facto in game industry are image files with linked one-to one frames of animation.
So, what have android to work with it?

1. Creating animation from some files contained separated images. Ugly and painful way.
2. Using what?

In j2me i had well-formed set of classes for manage sets of frames and those intrinsic bounds inside frame
What android can offer me to replacing my set of classes?

I want to use something like Sprite.load("my_chain_of_frames.png") and then use Sprite.images[x] in code.

Thanx.
Ingersol
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Dec 06, 2008 2:49 pm

Top

Solution

Postby amaguran » Thu Apr 16, 2009 1:24 pm

Hi,

Have you found a solution?

Thanks.
amaguran
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Apr 16, 2009 1:20 pm

Re: Solution

Postby Ingersol » Thu Apr 16, 2009 1:30 pm

amaguran wrote:Hi,

Have you found a solution?

Thanks.


Yes, i have solution - i ported j2me classes to android. Unfortunally, they are
copyrighted so i cannot open they. But in next 3-4 weeks ill write new open
source classes implementation and spritemaker support tool.
Ingersol
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Dec 06, 2008 2:49 pm

Re: Solution

Postby talvarBaksh » Sat May 02, 2009 2:13 pm

There is another way, using Path's.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                         Path path = new Path();
  2.                         path.addRect(new RectF(xPos + bmOffset[currBodyState], yPos, xPos + bmOffset[currBodyState]+90, yPos+114), Path.Direction.CW);
  3.                         canvas.clipPath(path);
  4.                        
  5.                         canvas.drawBitmap(bmBody, xPos , yPos, null);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


This way only the portion of the bitmap defined in "new RectF()" will be displayed, and you'd have to iterate it yourself somehow. I haven't gotten this solution exactly working, but currently it does display a different frame per "tick", but ihave not got the positioning right.

Ingersol wrote:
amaguran wrote:Hi,

Have you found a solution?

Thanks.


Yes, i have solution - i ported j2me classes to android. Unfortunally, they are
copyrighted so i cannot open they. But in next 3-4 weeks ill write new open
source classes implementation and spritemaker support tool.
talvarBaksh
Once Poster
Once Poster
 
Posts: 1
Joined: Sat May 02, 2009 1:41 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 6 guests