Exemplo n.º 1
0
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize winSize = Layer.VisibleBoundsWorldspace.Size;
            float  x       = winSize.Width / 2;
            float  y       = 0 + (winSize.Height / 2);

            var blocksSprite = new CCSprite("Images/blocks9.png");

            var blocks = new CCScale9Sprite();

            blocks.UpdateWithSprite(blocksSprite, new CCRect(0, 0, 96, 96), false, new CCRect(0, 0, 96, 96));

            blocks.Position = new CCPoint(x, y);

            AddChild(blocks);
        }
Exemplo n.º 2
0
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize winSize = Layer.VisibleBoundsWorldspace.Size;
            float  x       = winSize.Width / 2;
            float  y       = 0 + (winSize.Height / 2);

            var spriteScaledWithInsets = new CCSprite("Images/blocks9.png");

            var blocksScaledWithInsets = new CCScale9Sprite();

            blocksScaledWithInsets.UpdateWithSprite(spriteScaledWithInsets, new CCRect(0, 0, 96, 96), false,
                                                    new CCRect(32, 32, 32, 32));

            blocksScaledWithInsets.ContentSize = new CCSize(96 * 4.5f, 96 * 2.5f);

            blocksScaledWithInsets.Position = new CCPoint(x, y);

            AddChild(blocksScaledWithInsets);
        }