Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using CocosNet.Layers;
- using CocosNet.Labels;
- using System.Drawing;
- using CocosNet;
- using CocosNet.Menus;
- using MonoTouch.UIKit;
- using CocosNet.Support;
- using CocosNet.Sprites;
- using CocosNet.Actions;
- namespace MyTest
- {
- public class BallScene : ColorLayer
- {
- protected Sprite ball;
- public BallScene ()
- {
- SizeF s = Director.Instance.WinSize;
- //Заголовок
- Label label = new Label("Прыгающий мячик", "Arial", 32);
- label.SetPosition(s.Width / 2f, s.Height - 50);
- AddChild(label, 9999);
- //Кнопка для меню
- MenuItemImage item1 = new MenuItemImage("button.png", "button.png");
- item1.Click += HandleItem1Click;
- //Меню
- Menu menu = new Menu(item1);
- menu.SetPosition(s.Width / 2f, s.Height - 150);
- AddChild(menu, 9999);
- //Мяч
- ball = new Sprite("ball.png");
- ball.SetPosition(50, 50);
- AddChild(ball, 1);
- }
- void HandleItem1Click (object sender, EventArgs e)
- {
- //MessageBox.Show("Кнопка нажата", "Привет!");
- var jump = new JumpBy(2, new PointF(230, 0), 50, 5);
- ball.RunAction(new Sequence(jump, jump.Reverse() as IntervalAction));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment