コード例 #1
0
        void ItemsSourceChanged(BindableObject bindable, object oldValue, object newValue)
        {
            if (MenuItemsSource == null)
            {
                return;
            }

            var notifyCollection = newValue as INotifyCollectionChanged;

            if (notifyCollection != null)
            {
                HideButtons(MenuItemsSource, 0);
                OuterCircle.Draw();
                InnerButtonMenu.Draw();
                InnerButtonClose.Draw();
                BackButton.Draw();
                foreach (RadialMenuItem newItem in MenuItemsSource)
                {
                    OrganizeItem(newItem);
                    if (!mainGrid.Children.Contains(newItem))
                    {
                        mainGrid.Children.Add(newItem);
                    }
                    var source = (Xamarin.Forms.FileImageSource)newItem.Source;
                    HandleOptionClicked(newItem, newItem.Location);
                }

                notifyCollection.CollectionChanged += (sender, e) =>
                {
                    if (e.NewItems != null)
                    {
                        var tempList = new List <object>();
                        if (e.NewItems != null)
                        {
                            foreach (RadialMenuItem newItem in e.NewItems)
                            {
                                tempList.Add(newItem);
                                OrganizeItem(newItem);
                                if (!mainGrid.Children.Contains(newItem))
                                {
                                    mainGrid.Children.Add(newItem);
                                }
                                var source = (Xamarin.Forms.FileImageSource)newItem.Source;
                                HandleOptionClicked(newItem, newItem.Location);
                            }
                            foreach (var newItem in MenuItemsSource)
                            {
                                var item = newItem as RadialMenuItem;
                                tempList.Add(item);
                            }

                            MenuItemsSource = tempList;
                        }
                    }
                };
            }
        }
コード例 #2
0
        /// <summary>
        /// シーン内の描画処理
        /// </summary>
        public void Draw()
        {
            TextureAsset.Draw(LogoImageHandle, 490, 90, 300, 300, DX.TRUE);
            IpAddressText.Draw();
            PortNumberText.Draw();
            SaveIpAddressButton.Draw();
            switch (state)
            {
            case State.Start:
                StartButton.Draw();
                StartButton.DrawText();
                EndButton.Draw();
                EndButton.DrawText();
                break;

            case State.Select:
                BackButton.Draw();
                BackButton.DrawText();
                MakeRoomButton.Draw();
                MakeRoomButton.DrawText();
                JoinRoomButton.Draw();
                JoinRoomButton.DrawText();
                break;

            case State.FindRoom:
                BackButton.Draw();
                BackButton.DrawText();
                FindRoomButton.Draw();
                FindRoomButton.DrawText();
                SubmitButton.Draw();
                SubmitButton.DrawText();
                roomName.Draw();
                playerName.Draw();
                FontAsset.Draw("button1Base", "部屋名", roomName.x1 - 250, roomName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "プレイヤー名", playerName.x1 - 250, playerName.y1 + 5, DX.GetColor(125, 125, 125));
                break;

            case State.MakeRoom:
                BackButton.Draw();
                BackButton.DrawText();
                SubmitButton.Draw();
                SubmitButton.DrawText();
                roomName.Draw();
                playerName.Draw();
                playerNum.Draw();
                FontAsset.Draw("button1Base", "部屋名", roomName.x1 - 260, roomName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "プレイヤー名", playerName.x1 - 260, playerName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "人数", playerNum.x1 - 260, playerNum.y1 + 5, DX.GetColor(125, 125, 125));
                break;

            case State.Load:
                BackButton.Draw();
                BackButton.DrawText();
                LoadTexture.Draw();
                break;

            case State.Popup:
                if (FindRoomWindow.IsVisible)
                {
                    FindRoomWindow.Draw();
                }
                break;

            default:
                break;
            }
        }