I want to create an animated screen eg, rotating a ball in a screen
Please give me solution quickly
I want to create an animated screen eg, rotating a ball in a screen
Please give me solution quickly
Do you mean that you want to use a MAUI::Screen (the UI component) or just do it by doing regular drawing. Do you want to draw an animation or do you want to render the rotating ball in realtime?
Usually, if you're using the event-driven Moblet architecture, you want to register a timer and update the screen at every tick.
// Niklas
Thnx for the reply..
I want to draw an rotating animated ball in MAUI::Screen
Plz give the solution quickly
Hi Pankaj,
There is an AnimatedImage widget in MAUI. You need to create an image with all of the frames in it, and then provide co-ordinates to tell the widget how large each frame is. You can then use this for the animated ball.
I have this way ,I want to yous evualuate it.I have uploaded file to yous see .
| Attachment | Size |
|---|---|
| AnimatedImage.rar | 817.46 KB |
I have builded a GifImage class support for display images list.
Hi !
I want to animate an Image in Mosync, but the image not animating. i have used a following code.
can u give me any reference?
#include
#include
#include
#include
using namespace MAUtil;
using namespace MAUI;
#define RES_FRAMES 1
class MyScreen : public Screen
{
public:
AnimatedImage* img;
MyScreen() : Screen()
{
img = new AnimatedImage( 0, 0, EXTENT_X(maGetScrSize()), 150, NULL, RES_FRAMES );
this -> setMain( img );
}
virtual void show()
{
img ->setDirection( 270 ); // maybe 180?
img ->setFps( 1 );
img ->setFrame( 0 );
img ->setFrameHeight( 800 );
img ->setNumFrames( 5 );
Screen::show();
img -> start();
}
};
class MyMoblet : public Moblet
{
public:
MyMoblet()
{
MyScreen *s = new MyScreen();
s->show();
}
void keyPressEvent(int keyCode, int nativeCode)
{
if (MAK_BACK == keyCode || MAK_0 == keyCode)
{
// Call close to exit the application.
close();
}
}
void keyReleaseEvent(int keyCode, int nativeCode)
{
}
void pointerPressEvent(MAPoint2d point)
{
}
};
extern "C" int MAMain()
{
Moblet::run( new MyMoblet() );
return 0;
}
Hi,
There is a bug in the MAUI AnimatedImage widget. Have a look here, and use the fixed code.
https://github.com/MoSync/MoSync
Thanks
#include
#include
#include
#include
These are included files and image is.
Thanks !
Hi , I used ur Animtest project, it works really well. Now i want to calculate fps of that animated image. can u give me any reference?
Hmm, I'm not sure I understand. With AnimatedImage you set the fps you want it to have, not measure how many it can do. e.g myAnim->setFps(3);
I want to calculate fps of animated image which varies per sec , just like in QUQKEMDL project in Mosync.
In QuakeMDL project, fps is shown on the screen. just like that I want to show fps of animated image on screen.
can u give me any reference? pls.
The difference between AnimatedImage and QuakeMDL is that QuakeMDL paints as fast as it can, so the fps is an indication of the speed of the software, device and model. With AnimatedImage, it animates at the rate you've set, even if that is 1000 fps. It may not finish a paint in 1/1000th of a second, but it will attempt it. There isn't a way to test the fps of AnimatedImage because it is fixed to the value you set.
OK ! it means we cant get fps of animated image.
You can, but its an instruction, not a measurement
int fps = 10;
myAnim->setFps(fps);
printf("Animation FPS %d", fps"); Hello ! I have used code of Downloading Images from Intrenet and it works. but its not working for animated image.
I want to download animated image. can u pls give me any solution.
Hi,
is it working with locally stored animations? There shouldn't be a problem if you know the size of each frame. There has been a bug in some versions AnimatedImage, and I'm not sure which versions are fixed. Try it with a local animation first, and then see if you can do it again with downloading the same image online. Have a look here http://www.mosync.com/content/animation
My problem is when I download simple image it works,
but when i download animated image it is giving panic error 40001.
invalid resource type.
I m using Mosync 2.7.
But does it work if the animation isn't downloaded, and you've added it as a resource to the project?
I can't email you back, you've exceeded your quota. Here is the email I tried to send
Many platforms don't support viewing gif images. When you said that your animation doesn't work, did you mean that your animated gif doesn't work? Animated gifs are only supported by the browser in a native WebView control.
AnimatedImages aren't as well documented as I thought they were. What you need to do is to create a single image, with each frame the same size and width, and each frame aligned vertically. You tell the AnimatedImage widget the height of each frame, and the number of frames per second you want it do, and when you want it to start and stop.