コード例 #1
0
        public void makeStats()
        {
            int counter = 0;

            stringSpritesArr[counter] = new StringSprite("HERO STAT:", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"MAX ATTACK = {hero.maxDamage} ATK | MIN ATTACK = {hero.minDamage}", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"MAX ARMOR  = {hero.maxDef} ARM | MIN ARMOR = {hero.minDef}", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"MAX HEALTH = {hero.maxHealth} HP", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"CURRENT HP = {hero.health} HP", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"LEVEL = {hero.level}", gameScreen, counter);
            counter++;
            stringSpritesArr[counter] = new StringSprite($"{hero.experience} / {hero.nextLevel} XP", gameScreen, counter);
        }
コード例 #2
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public override IEnumerator<bool> Execute()
        {
            Manager.Add(sum, 1);
            Manager.AddRangeTo(uvs, 1);
            Manager.AddRangeTo(seluvs, 1);
            Manager.AddRangeTo(udc, 2);
            foreach (var i in udc) i.AddSubOperation(SpritePatterns.Blink(30, 0.8, Easing.Linear));
            Manager.Add(mc, 2);
            Manager.AddRangeTo(selopts, 1);
            Manager.OffsetX = 640;
            Manager.OffsetY = 240;
            //突入
            for (int i = 0; i < 40; i++)
            {
                Manager.OffsetX = Easing.OutQuad(i, 40, 640, -640);
                yield return true;
            }
            Manager.OffsetX = 0;

            prevstate = Gamepad.GetState();
            while (true)
            {
                state = Gamepad.GetState();
                tstate = state.GetTriggerStateWith(prevstate);
                switch (cstate)
                {
                    case 0:
                        if (tstate.Buttons[1])
                        {
                            Parent.SendChildMessage("ReturnToOptionEdit");
                            CommonObjects.SoundMenuCancel.Play();
                            for (int i = 0; i < 40; i++)
                            {
                                Manager.OffsetX = Easing.OutQuad(i, 40, 0, 640);
                                yield return true;
                            }
                            goto EXIT;
                        }
                        if (tstate.Buttons[0])
                        {
                            CommonObjects.SoundMenuOK.Play();
                            if (usel == selopts.Count - 1)
                            {
                                var ol = new OptionInformation[5];
                                for (int i = 0; i < avu; i++)
                                {
                                    ol[i] = new OptionInformation(opts[i]);
                                    ol[i].TargetOperation = OptionOperations.SelectionInformation[osi[i]].Operation;
                                    ol[i].InitializationInformation = oii[i];
                                }
                                Parent.SendChildMessage("ApplyOptionInformation", ol);
                                Parent.SendChildMessage("StartGame");
                                for (int i = 0; i < 40; i++)
                                {
                                    Manager.OffsetX = Easing.OutQuad(i, 40, 0, -640);
                                    yield return true;
                                }
                                goto EXIT;
                            }
                            else
                            {
                                GoToEditingMode();
                            }
                        }
                        if ((tstate.Direction & GamepadDirection.Up) != 0)
                        {
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y - 96, Easing.OutQuad));
                            usel = (usel + (selopts.Count - 1)) % selopts.Count;
                            selopts[usel].Y = 128 + 96;
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y - 96, Easing.OutQuad));
                            if (usel < avu) RefreshOptionInformation(false);
                            smsel = 0;
                            mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
                            CommonObjects.SoundMenuSelect.Play();
                        }
                        if ((tstate.Direction & GamepadDirection.Down) != 0)
                        {
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y + 96, Easing.OutQuad));
                            usel = (usel + 1) % selopts.Count;
                            selopts[usel].Y = 128 - 96;
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y + 96, Easing.OutQuad));
                            if (usel < avu) RefreshOptionInformation(false);
                            smsel = 0;
                            mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
                            CommonObjects.SoundMenuSelect.Play();
                        }
                        break;
                    case 1:
                        SubMenuOperation();
                        break;
                    case 2:
                        if (!UserValueInputOperation())
                        {
                            var ivs = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "入力値が不正です!", X = seluvs[smsel].X, Y = seluvs[smsel].Y };
                            ivs.AddSubOperation(SpritePatterns.VerticalFadeOut(60, -64, Easing.OutQuad, Easing.Linear));
                            Manager.Add(ivs, 3);
                        }
                        break;
                }
                prevstate = state;
                yield return true;
            }
            EXIT: ;
        }
コード例 #3
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public TitleChildSceneOptionEdit(User[] op)
        {
            opts = op;
            osi = new int[opts.Length];
            oii = new OptionInitializationInformation[opts.Length];
            sum = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "オプション装備編集", X = 230, Y = 8 };
            type = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "装備タイプ", X = 160, Y = 32 + 8 };
            dirc = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Green) { Value = "装備方向", X = 160, Y = 64 + 8 };
            mode = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Green) { Value = "モード", X = 160, Y = 96 + 8 };
            uvdesc = new List<StringSprite>()
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "装備固有オプション1", X = 160, Y = 128 + 8 },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "装備固有オプション2", X = 160, Y = 160 + 8 },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "装備固有オプション3", X = 160, Y = 192 + 8 },
            };

            seltype = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 32 + 8 };
            seldirc = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 64 + 8 };
            selmode = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 96 + 8 };
            ipuvdesc = new List<StringSprite>()
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 128 + 8 },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 160 + 8 },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "", X = 360, Y = 192 + 8 },
            };

            uvs = new List<StringSprite>();
            uvs.Add(type);
            uvs.Add(dirc);
            uvs.Add(mode);
            uvs.AddRange(uvdesc);

            seluvs = new List<StringSprite>();
            seluvs.Add(seltype);
            seluvs.Add(seldirc);
            seluvs.Add(selmode);
            seluvs.AddRange(ipuvdesc);

            uvsmal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation{ X = 144, Y = 48 },
                new MenuAllocationInformation{ X = 144, Y = 80 },
                new MenuAllocationInformation{ X = 144, Y = 112 },
                new MenuAllocationInformation{ X = 144, Y = 144 },
                new MenuAllocationInformation{ X = 144, Y = 176 },
                new MenuAllocationInformation{ X = 144, Y = 208 },
            };

            for (int i = 0; i < uvsmal.Count; i++)
            {
                int ci = i;
                uvsmal[i].Upper = uvsmal[(i + uvsmal.Count - 1) % uvsmal.Count];
                uvsmal[i].Lower = uvsmal[(i + 1) % uvsmal.Count];
                uvsmal[i].AvailableChangingAction =
                    (p, v) =>
                    {
                        uvs[ci].Alpha = seluvs[ci].Alpha = v ? 1.0 : 0.5;
                    };
                if (i >= 1) uvsmal[i].IsAvailable = false;
            }

            udc = new[]
            {
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.8,ScaleY=0.4,Image=CommonObjects.ImageCursor128[2],X=64,Y=48},
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.8,ScaleY=0.4,Image=CommonObjects.ImageCursor128[3],X=64,Y=208},
            };
            selopts = new List<MultiAdditionalCoroutineSprite>();
            foreach (var i in opts)
            {
                if (i == null) continue;
                selopts.Add(new MultiAdditionalCoroutineSprite() { HomeX = 48, HomeY = 48, X = 64, Y = 128, Image = BigUserImageManager.GetUserImage(i), Alpha = 0 });
            }
            avu = selopts.Count;
            for (int i = 0; i < avu; i++)
            {
                osi[i] = 0;
                oii[i] = new OptionInitializationInformation();
            }
            selopts.Add(new MultiAdditionalCoroutineSprite() { HomeX = 48, HomeY = 48, X = 64, Y = 128, Image = CommonObjects.ImageOptionEditEnd, Alpha = 0 });
            selopts[usel].Alpha = 1;

            mc = new MultiAdditionalCoroutineSprite() { Image = CommonObjects.ImageCursor128[1], HomeX = 64, HomeY = 64, ScaleX = 0.25, ScaleY = 0.25 };
            mc.X = uvsmal[smsel].X;
            mc.Y = uvsmal[smsel].Y;
        }
コード例 #4
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public IEnumerator<bool> Execute()
        {
            DX.SetDrawMode(DX.DX_DRAWMODE_BILINEAR);
            info = new AccountInformation(Kbtter.Instance.Setting.Accounts.ToArray());
            //The Kbtter Project
            var kbp = new Sprite() { Image = CommonObjects.ImageKbtterProject, HomeX = 256, HomeY = 32, X = 320, Y = 240 };
            Manager.Add(kbp, 0);
            for (int i = 0; i < 120; i++)
            {
                kbp.ScaleX = kbp.ScaleY = Easing.OutBounce(i, 120, 4, -3);
                kbp.Alpha = Easing.OutSine(i, 120, 0, 1);
                yield return true;
            }
            kbp.ScaleX = kbp.ScaleY = 1;
            kbp.Alpha = 1;
            for (int i = 0; i < 120; i++) yield return true;
            for (int i = 0; i < 60; i++)
            {
                kbp.Alpha = Easing.OutSine(i, 60, 1, -1);
                yield return true;
            }
            kbp.IsDead = true;

            //タイトル画面
            var back = new RectangleObject() { Width = 640, Height = 480, Color = CommonObjects.Colors.White, AllowFill = true };
            Manager.Add(back, 0);
            for (int i = 0; i < 60; i++)
            {
                back.Alpha = Easing.OutSine(i, 60, 0, 1);
                yield return true;
            }
            back.Alpha = 1;

            var logo = new Sprite() { Image = CommonObjects.ImageLogo, HomeX = 240, HomeY = 80, X = 320 };
            Manager.Add(logo, 1);
            for (int i = 0; i < 60; i++)
            {
                logo.Y = Easing.OutBounce(i, 60, -160, 320);
                yield return true;
            }

            //Press Z
            var pz = new StringSprite(CommonObjects.FontSystemBig, CommonObjects.Colors.Black) { Value = "Press Button", X = 320, Y = 400, HomeX = 160 };
            var pzdx = DX.GetDrawStringWidthToHandle("Press Button", 12, CommonObjects.FontSystemBig);
            pz.HomeX = pzdx / 2;
            Manager.Add(pz, 1);
            do
            {
                for (int i = 0; i < 30 && !tstate.Buttons.Any(p => p); i++)
                {
                    pz.Alpha = Easing.Linear(i, 30, 0, 1);
                    yield return true;
                }
                for (int i = 0; i < 30 && !tstate.Buttons.Any(p => p); i++)
                {
                    pz.Alpha = Easing.Linear(i, 30, 1, -1);
                    yield return true;
                }
            } while (!tstate.Buttons.Any(p => p));
            CommonObjects.SoundMenuOK.Play();
            var st = pz.Alpha;
            for (int i = 0; i < 30; i++)
            {
                pz.Alpha = Easing.Linear(i, 30, st, -st);
                yield return true;
            }
            pz.IsDead = true;

            //menu
            menu = new[]
            {
                new AdditionalCoroutineSprite(){HomeX=160,HomeY=64,Image=CommonObjects.ImageTitleMenuStart,Y=720},
                new AdditionalCoroutineSprite(){HomeX=160,HomeY=64,Image=CommonObjects.ImageTitleMenuQuick,Y=720},
                new AdditionalCoroutineSprite(){HomeX=160,HomeY=64,Image=CommonObjects.ImageTitleMenuOption,Y=720},
                new AdditionalCoroutineSprite(){HomeX=160,HomeY=64,Image=CommonObjects.ImageTitleMenuRanking,Y=720},
            };
            Manager.AddRangeTo(menu, 1);
            for (int i = 0; i < menu.Length; i++)
            {
                menu[i].X = 320 + 256 * i;
                if (i != selmenu)
                {
                    menu[i].Alpha = 0.5;
                    menu[i].ScaleX = menu[i].ScaleY = 0.8;
                }
                menu[i].ApplySpecialOperation(SpritePatterns.MenuIntro(i * 15, 60, 400));
            }

            lrc = new[]
            {
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.5,ScaleY=0.8,Image=CommonObjects.ImageCursor128[0],X=120,Y=400},
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.5,ScaleY=0.8,Image=CommonObjects.ImageCursor128[1],X=520,Y=400},
            };
            Manager.AddRangeTo(lrc, 2);
            foreach (var i in lrc) i.AddSubOperation(SpritePatterns.Blink(30, 0.8, Easing.Linear));

            while (true)
            {
                switch (modestate)
                {
                    case 0:
                        //メニュー選択
                        while (!menu.All(p => p.SpecialOperation == null)) yield return true;
                        while (true)
                        {
                            if ((tstate.Direction & GamepadDirection.Left) != 0)
                            {
                                selmenu = (selmenu + menu.Length - 1) % menu.Length;
                                RefreshMenuPosition();
                                CommonObjects.SoundMenuSelect.Play();
                            }
                            if ((tstate.Direction & GamepadDirection.Right) != 0)
                            {
                                selmenu = (selmenu + 1) % menu.Length;
                                RefreshMenuPosition();
                                CommonObjects.SoundMenuSelect.Play();
                            }
                            if (tstate.Buttons[0])
                            {
                                //救済措置
                                if (selmenu == 0)
                                {
                                    CommonObjects.SoundMenuOK.Play();
                                    for (int i = 0; i < menu.Length; i++)
                                    {
                                        menu[i].ApplySpecialOperation(SpritePatterns.MenuIntro(0, 60, 600));
                                    }
                                    foreach (var i in lrc) i.AddSubOperation(SpritePatterns.MenuOutro(0, 60, 600));
                                    break;
                                }
                            }
                            yield return true;
                        }
                        switch (selmenu)
                        {
                            case 0:
                                //Start
                                Children.AddChildScene(new TitleChildSceneAccountSelect(info));
                                break;
                            case 1:
                                //Quick
                                break;
                            case 2:
                                //Option
                                break;
                            case 3:
                                //Ranking
                                break;
                        }
                        modestate = 1;
                        break;
                    case 1:
                        //サブタスク動作
                        yield return true;
                        break;
                    case 2:
                        for (int i = 0; i < 60; i++)
                        {
                            Manager.Alpha -= 1.0 / 60.0;
                            yield return true;
                        }
                        Manager.Alpha = 0;
                        goto EXIT;
                }
            }
            EXIT:
            Kbtter5.CurrentScene = new SceneGame(info.Accounts[selac], new UserInformation(info.Users[selac]), optinfo);
        }
コード例 #5
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public override IEnumerator<bool> Execute()
        {
            sname = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { X = 48, Y = 14, Value = "ここに表示されます" };
            tweets = new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Red) { Value = "Loading...", X = 96, Y = 48 };
            fav = new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Red) { Value = "Loading...", X = 96, Y = 68 };
            friend = new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Red) { Value = "Loading...", X = 96, Y = 88 };
            follower = new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Red) { Value = "Loading...", X = 96, Y = 108 };
            img = new Sprite() { X = 0, Y = 4 };

            X = 320;
            Y = 80;
            Manager.Add(new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Black) { Value = "ツイート数", X = 0, Y = 48 }, 0);
            Manager.Add(new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Black) { Value = "お気に入り", X = 0, Y = 68 }, 0);
            Manager.Add(new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Black) { Value = "フォロー", X = 0, Y = 88 }, 0);
            Manager.Add(new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Black) { Value = "フォロワー", X = 0, Y = 108 }, 0);

            Manager.Add(sname, 0);
            Manager.Add(img, 0);
            Manager.Add(tweets, 0);
            Manager.Add(fav, 0);
            Manager.Add(friend, 0);
            Manager.Add(follower, 0);

            while (true) yield return true;
        }
コード例 #6
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public UserInformationPanel()
        {
            Manager = new ObjectManager(2);
            username = new StringSprite(CommonObjects.FontSystemLarge, CommonObjects.Colors.Blue) { Value = "Loading...", X = 128, Y = 40 };
            shots = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 80 };
            bombs = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 104 };
            defp = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 128 };
            defb = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 152 };
            grep = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 176 };
            colr = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { Value = "Loading...", X = 256, Y = 200 };

            u_tw = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "Loading...", X = 512, Y = 80 };
            u_fav = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "Loading...", X = 512, Y = 104 };
            u_fr = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "Loading...", X = 512, Y = 128 };
            u_fo = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "Loading...", X = 512, Y = 152 };

            uim = new Sprite() { HomeX = 48, HomeY = 48, X = 64, Y = 128 };
        }
コード例 #7
0
ファイル: SceneTitle.cs プロジェクト: kb10uy/Kbtter4
        public TitleChildSceneOptionUserSelect(AccountInformation ainfo, int idx, bool back, User[] us)
        {
            b = back;
            ai = ainfo;
            uinfo = new UserInformation(ai.Users[idx]);
            index = idx;
            mvf = (ta, aid, max) => (mai, val) =>
            {
                if (max > aid) ta[aid].Alpha = val ? 1.0 : 0.5;
            };
            users = us;
            opod = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 64 - 8, Value = "1st" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 96 - 8, Value = "2nd" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 128 - 8, Value = "3rd" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 160 - 8, Value = "4th" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 192 - 8, Value = "5th" }
            };
            next = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { X = 64, Y = nextpos - 8, Value = "決定" };
            opsn = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 64 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 96 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 128 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 160 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 192 - 8, Value = "" }
            };
            mal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){ X = 32, Y = 64 },
                new MenuAllocationInformation(){ X = 32, Y = 96 },
                new MenuAllocationInformation(){ X = 32, Y = 128 },
                new MenuAllocationInformation(){ X = 32, Y = 160 },
                new MenuAllocationInformation(){ X = 32, Y = 192 },
                new MenuAllocationInformation(){ X = 32, Y = 224 },
            };
            opop = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 224 - 8, Value = "編集        削除" };
            opopmal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){X=40,Y=224},
                new MenuAllocationInformation(){X=136,Y=224},
            };

            okcancel = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "OK", X = 528, Y = 180 , Alpha = 0},
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "キャンセル", X = 528, Y = 204, Alpha = 0 }
            };
            ocmal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){X=512,Y=180+8,IsAvailable=false},
                new MenuAllocationInformation(){X=512,Y=204+8},
            };
            ouip = new OptionUserInformationPanel(ai.Tokens[index], ai.Users[index])
            {
                ChangingAction = (p) =>
                {
                    //タイムラグ対策
                    if (cs != 2) return;
                    if (p && users.Where(q => q != null).All(q => q.Id != ouip.SourceUser.Id))
                    {
                        valid.Value = "オプションOK";
                        valid.Color = CommonObjects.Colors.Blue;
                        ocmal[0].IsAvailable = true;
                    }
                    else
                    {
                        valid.Value = "オプションNG";
                        valid.Color = CommonObjects.Colors.Red;
                        ocmsel = 1;
                        ocmal[0].IsAvailable = false;
                        mc.AddSubOperation(SpritePatterns.VerticalMove(10, ocmal[ocmsel].Y, Easing.OutQuad));
                    }
                }
            };
            for (int i = 0; i < opopmal.Count; i++)
            {
                opopmal[i].Lefter = opopmal[(i + opopmal.Count - 1) % opopmal.Count];
                opopmal[i].Righter = opopmal[(i + 1) % opopmal.Count];
            }
            for (int i = 0; i < ocmal.Count; i++)
            {
                ocmal[i].Upper = ocmal[(i + ocmal.Count - 1) % ocmal.Count];
                ocmal[i].Lower = ocmal[(i + 1) % ocmal.Count];
                ocmal[i].AvailableChangingAction = mvf(okcancel, i, okcancel.Count);
            }
            for (int i = 0; i < mal.Count; i++)
            {
                mal[i].Upper = mal[(i + mal.Count - 1) % mal.Count];
                mal[i].Lower = mal[(i + 1) % mal.Count];
                mal[i].AvailableChangingAction = mvf(opod, i, opod.Count);
                mal[i].IsAvailable = (i < users.Length && users[i] != null) || i == mal.Count - 1 || (users.Count(p => p != null) == i);
            }
            for (int i = 0; i < opsn.Count; i++)
            {
                if (users[i] != null) opsn[i].Value = users[i].ScreenName;
            }

            valid = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 320, Y = 216, Value = "オプションOK/NG" };
            mc = new MultiAdditionalCoroutineSprite() { Image = CommonObjects.ImageCursor128[1], HomeX = 64, HomeY = 64, ScaleX = 0.25, ScaleY = 0.25 };
            cs = 0;
            ki = null;
            msel = 0;
            ocmsel = 0;
        }
コード例 #8
0
ファイル: SceneGame.cs プロジェクト: kb10uy/Kbtter4
 public SceneGame(Kbtter4Account ac, UserInformation ui, OptionInformation[] opt)
 {
     optinfo = opt.Where(p => p != null).ToArray();
     info = ui;
     TwitterTokens = Tokens.Create(Kbtter.Setting.Consumer.Key, Kbtter.Setting.Consumer.Secret, ac.AccessToken, ac.AccessTokenSecret);
     Player = new PlayerUser(this, ui, PlayerMovingOperations.MouseOperaiton, PlayerShotOperations.Default, PlayerInputMethods.DefaultStyle);
     BackgroundImagePath = CommonObjects.GetUserFilePath("back_" + ui.SourceUser.Id.ToString() + ".png");
     Information = new InformationBox(info, Player)
     {
         X = 0,
         Y = 480
     };
     StringInfo = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.White)
     {
         X = 280,
         Y = 240,
         Value = "Loading"
     };
     options = new List<PlayerOption>();
     options.AddRange(optinfo.Select(p => new PlayerOption(Player, p, this)));
 }