Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Create a Growing Sprite?

Create a Growing Sprite?

All your problems with Audio, Video and Images.

Create a Growing Sprite?

Postby adqazwsx » Sun Jul 25, 2010 8:02 pm

What is the easiest way to create a sprite that grows over time. The sprite is contained on a SurfaceView and will be used for a game. My current implementation is to change the size of mPositionRectangle to be the desired mWidth and mHeight.

I currently use the following to grow the bitmap:
Code: Select all
    public void update(long deltaTime) {
       super.update(deltaTime);
       //TODO FIX
       double pixelsThisTick = mGrowthPerSecond * ((double) deltaTime) / MILLI_IN_SECOND;
       mWidth += pixelsThisTick;
       mHeight += pixelsThisTick;
       
       mPosition.xPos -= pixelsThisTick / 2;
       mPosition.yPos -= pixelsThisTick / 2;
       
       if(mWidth >= mMaxSize) mIsGrowing = false;

    }


And this to handle the drawing:
Code: Select all
    public void draw(Canvas c){
       c.drawBitmap(mBitmap, mDrawableRectangle, mPositionRectangle, null);
    }


This all works on the emulator, but does not work on the phone for some reason. On the phone the width of the sprites doesn't change.

Is there a better way to do this? I was considering using an animated sprite, but I need an implementation which is independent of screen size. Thanks for the help.
adqazwsx
Freshman
Freshman
 
Posts: 8
Joined: Thu Jul 08, 2010 12:44 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 4 guests