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);

            CCLog.Log("S9BatchNodeBasic ...");

            var batchNode = new CCSpriteBatchNode("Images/blocks9.png");
            //batchNode.AnchorPoint = new CCPoint(0.5f, 0.5f);
            CCLog.Log("batchNode created with : Images/blocks9.png");

            var blocks = new CCScale9Sprite();
            CCLog.Log("... created");

            blocks.UpdateWithBatchNode(batchNode, new CCRect(0, 0, 96, 96), false, new CCRect(0, 0, 96, 96));
            CCLog.Log("... updateWithBatchNode");

            blocks.Position = new CCPoint(x, y);
            CCLog.Log("... setPosition");

            AddChild(blocks);
            CCLog.Log("AddChild");

            CCLog.Log("... S9BatchNodeBasic done.");
        }
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);

            CCLog.Log("S9BatchNodeScaleWithCapInsets ...");

            var batchNode_scaled_with_insets = new CCSpriteBatchNode("Images/blocks9.png");
            CCLog.Log("batchNode_scaled_with_insets created with : Images/blocks9.png");

            var blocks_scaled_with_insets = new CCScale9Sprite();
            CCLog.Log("... created");

            blocks_scaled_with_insets.UpdateWithBatchNode(batchNode_scaled_with_insets, new CCRect(0, 0, 96, 96), false,
                                                          new CCRect(32, 32, 32, 32));
            CCLog.Log("... updateWithBatchNode");

            blocks_scaled_with_insets.ContentSize = new CCSize(96 * 4.5f, 96 * 2.5f);
            CCLog.Log("... setContentSize");

            blocks_scaled_with_insets.Position = new CCPoint(x, y);
            CCLog.Log("... setPosition");

            AddChild(blocks_scaled_with_insets);
            CCLog.Log("AddChild");

            CCLog.Log("... S9BatchNodeScaleWithCapInsets done.");
        }