⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sprite.h

📁 Symbian -画图程序 graphics-vc.rar
💻 H
字号:
/* Copyright (c) 2004, Nokia. All rights reserved */

#ifndef __SPRITE_H__
#define __SPRITE_H__

// INCLUDES
#include <e32base.h>

// FORWARD DECLARATIONS
class CFbsBitmap;

// CLASS DECLARATION

/**
* CSprite.
* An instance of class CSprite represents an object
* being displayed on the screen
*/
class CSprite : public CBase
    {
    public: // Constructors and destructors

        /**
        * NewL.
        * Two-phased constructor.
        * Create a CSprite object.
        * @param aXVelocity The velocity of the sprite on the x axis.
        * @param aYVelocity The velocity of the sprite on the y axis.
        * @param aInitialPosition The starting position of the sprite
        * on the screen.
        * @return A pointer to the created instance of CSprite.
        */
        static CSprite* NewL( TInt aXVelocity, TInt aYVelocity,
                              const TPoint& aInitialPosition );

        /**
        * NewLC.
        * Two-phased constructor.
        * Create a CSprite object.
        * @param aXVelocity The velocity of the sprite on the x axis.
        * @param aYVelocity The velocity of the sprite on the y axis.
        * @param aInitialPosition The starting position of the sprite
        * on the screen.
        * @return A pointer to the created instance of CSprite.
        */
        static CSprite* NewLC( TInt aXVelocity, TInt aYVelocity,
                               const TPoint& aInitialPosition );

        /**
        * ~CSprite
        * Virtual Destructor.
        */
        virtual ~CSprite();

    public: // New functions

        /**
        * Position
        * Return the position of the sprite on the screen.
        * @return The position
        */
        TPoint Position() const;

        /**
        * Move
        * Move the sprite.
        * @param aSize The size of the sprite
        * @param aBounds The rectangle the sprite is allowed to move in
        */
        void Move( const TSize& aSize, const TRect& aBounds );

    private: // Constructors

        /**
        * CSprite
        * Perform the first phase of two phase construction.
        * @param aXVelocity The velocity of the sprite on the x axis.
        * @param aYVelocity The velocity of the sprite on the y axis.
        * @param aInitialPosition The starting position of the sprite
        * on the screen.
        */
        CSprite( TInt aXVelocity,TInt aYVelocity,
                 const TPoint& aInitialPosition );

        /**
        * ConstructL
        * 2nd phase constructor.
        * Perform the second phase construction of a CSprite object.
        */
        void ConstructL();

    private: // Data

        /**
        * iPosition
        */
        TPoint iPosition;

        /**
        * iXVelocity
        */
        TInt iXVelocity;

        /**
        * iYVelocity
        */
        TInt iYVelocity;
    };

#endif // __SPRITE_H__

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -