Пример #1
0
        public SpriteNilTexture()
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            CCSprite sprite = null;

            // TEST: If no texture is given, then Opacity + Color should work.

            sprite = new CCSprite();
            sprite.Init();
            sprite.TextureRect = new CCRect(0, 0, 300, 300);
            sprite.Color = CCTypes.CCRed;
            sprite.Opacity = 128;
            sprite.Position = (new CCPoint(3 * s.Width / 4, s.Height / 2));
            AddChild(sprite, 100);

            sprite = new CCSprite();
            sprite.Init();
            sprite.TextureRect = new CCRect(0, 0, 300, 300);
            sprite.Color = CCTypes.CCBlue;
            sprite.Opacity = 128;
            sprite.Position = (new CCPoint(1 * s.Width / 4, s.Height / 2));
            AddChild(sprite, 100);
        }