コード例 #1
0
ファイル: LayerScaleTest.cs プロジェクト: zhuruvl/CocosSharp
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize       s     = Layer.VisibleBoundsWorldspace.Size;
            CCLayerColor layer = new CCLayerColor(new CCColor4B(0xFF, 0x00, 0x00, 0x80));

            layer.IgnoreAnchorPointForPosition = false;
            layer.Position = (new CCPoint(s.Width / 2, s.Height / 2));
            AddChild(layer, 1, kTagLayer);
            //
            // Add two labels using BM label class
            // CCLabelBMFont
            var label1 = new CCLabelBMFont("LABEL1", "fonts/konqa32.fnt");

            layer.AddChild(label1);
            label1.Position = new CCPoint(layer.ContentSize.Width / 2, layer.ContentSize.Height * 0.75f);
            var label2 = new CCLabelBMFont("LABEL2", "fonts/konqa32.fnt");

            layer.AddChild(label2);
            label2.Position = new CCPoint(layer.ContentSize.Width / 2, layer.ContentSize.Height * 0.25f);


            //
            // Do the sequence of actions in the bug report
            layer.Visible = false;
            layer.RunActions(hide, scaleTo1, show, delay, scaleTo2, scaleTo3, scaleTo4, scaleTo5);
        }