Exemplo n.º 1
0
		public virtual CCTableViewCell TableCellAtIndex(CCTableView table, int idx)
		{
			string str = idx.ToString();
			var cell = table.DequeueCell();
			
			if (cell == null) {
				cell = new CustomTableViewCell();
				var sprite = new CCSprite("Images/Icon");
				sprite.AnchorPoint = CCPoint.Zero;
				sprite.Position = new CCPoint(0, 0);
				cell.AddChild(sprite);

				var label = new CCLabelTTF(str, "Helvetica", 20.0f);
				label.Position = CCPoint.Zero;
				label.AnchorPoint = CCPoint.Zero;
				label.Tag = 123;
				cell.AddChild(label);
			}
			else
			{
				var label = (CCLabelTTF)cell.GetChildByTag(123);
				label.Label = (str);
			}


			return cell;
		}
Exemplo n.º 2
0
		public override bool Init()
		{
			if (!base.Init())
				return false;

			var winSize = CCDirector.SharedDirector.WinSize;

			var tableView = new CCTableView(this, new CCSize(250, 60));
			tableView.Direction = CCScrollViewDirection.Horizontal;
			tableView.Position = new CCPoint(20,winSize.Height/2-30);
			tableView.Delegate = this;
			this.AddChild(tableView);
			tableView.ReloadData();

			tableView = new CCTableView(this, new CCSize(60, 280));
			tableView.Direction = CCScrollViewDirection.Vertical;
			tableView.Position = new CCPoint(winSize.Width - 150, winSize.Height/2 - 120);
			tableView.Delegate = this;
			tableView.VerticalFillOrder = CCTableViewVerticalFillOrder.FillTopDown;
			this.AddChild(tableView);
			tableView.ReloadData();

			// Back Menu
			var itemBack = new CCMenuItemFont("Back", toExtensionsMainLayer);
			itemBack.Position = new CCPoint(winSize.Width - 50, 25);
			var menuBack = new CCMenu(itemBack);
			menuBack.Position = CCPoint.Zero;
			AddChild(menuBack);

			return true;
		}
Exemplo n.º 3
0
 public CCSize TableCellSizeForIndex(CCTableView table, int idx)
 {
     if (idx == 2)
     {
         return new CCSize(100, 100);
     }
     return new CCSize(60, 60);
 }
Exemplo n.º 4
0
		public virtual CCSize CellSizeForTable(CCTableView table)
		{
			return new CCSize(60, 60);
		}
Exemplo n.º 5
0
		public virtual void TableCellTouched(CCTableView table, CCTableViewCell cell)
		{
            CCLog.Log("cell touched at index: {0}", cell.Index);
		}
Exemplo n.º 6
0
		public virtual int NumberOfCellsInTableView(CCTableView table)
		{
			return 20;
		}
Exemplo n.º 7
0
 public void TableCellWillRecycle(CCTableView table, CCTableViewCell cell)
 {
 }
Exemplo n.º 8
0
 public void TableCellUnhighlight(CCTableView table, CCTableViewCell cell)
 {
 }