Exemple #1
0
        public static CCSprite spriteWithFile(string fileName, CCRect rect)
        {
            CCSprite sprite = new CCSprite();

            if (sprite.initWithFile(fileName, rect))
            {
                return(sprite);
            }
            return(null);
        }
        /// <summary>
        /// Creates an sprite with an image filename.
        /// The rect used will be the size of the image.
        /// The offset will be (0,0).
        /// </summary>
        public static CCSprite spriteWithFile(string fileName)
        {
            CCSprite sprite = new CCSprite();

            if (sprite.initWithFile(fileName))
            {
                return(sprite);
            }

            sprite = null;
            return(sprite);
        }
Exemple #3
0
        /// <summary>
        /// Creates an sprite with an image filename and a rect.
        /// The offset will be (0,0).
        /// </summary>
        public static CCSprite spriteWithFile(string fileName, CCRect rect)
        {
            CCSprite sprite = new CCSprite();

            if (sprite.initWithFile(fileName, rect))
            {
                return sprite;
            }

            sprite = null;
            return sprite;
        }