/// <summary> /// 新規ステージの場合引数は""で,既存ステージはProgram.StageFileName +"\\"+ fileName + ".xlsx"の形式 /// </summary> /// <param name="fileName"></param> public StageMaker(string fileName) { IsPlayerExist = false; IsGoalExist = false; IsWarpSetting = false; IsWarpSearching = false; IsStageMaking = true; IsLoaded = false; WarpData = new List <int[]>(); ModeText = new GeneralText(new asd.Vector2DF(0 * Program.CellLarge, 0 * Program.CellLarge), "", 70, new asd.Color(2, 20, 20, 200), 2, new asd.Color(222, 222, 222, 200)); ModeText.Color = new asd.Color(200, 200, 200, 180); var explainString = "0~9とQ,W,Eで選択\n(手探ってください)\n \nShift-作る\n \nR-ワープ位置のセット\n \nSpace-テストプレイ\n" + " " + "(Saveされます)\n \nCtrl+S-セーブ\n \nZ-タイトルへ\n" + " " + "(Save無し)"; ExplainText = new GeneralText(new asd.Vector2DF(28.7f * Program.CellLarge, 8 * Program.CellLarge), explainString, 16, new asd.Color(2, 20, 20, 200), 5, new asd.Color(222, 222, 222, 200)); if (fileName == "") { FilePass = MakeFileName(); } else { FilePass = fileName; } PointX = (int)asd.Engine.Mouse.Position.X / CellLarge; PointY = (int)asd.Engine.Mouse.Position.Y / CellLarge; MakePos = new asd.Vector2DF(PointX * CellLarge + CellLarge / 2, PointY * CellLarge + CellLarge / 2); MakingNum = 0; SelectedTexture = new EnemyRed(MakePos); }
/// <summary> /// warpPotionの変化とかはこれを通して /// </summary> /// <param name="warp">ワープ先</param> public void ChangeWarpPos(WarpZone warp) { WarpPos = warp.Position; WarpID = warp.InstanceID; RemoveChild(WarpIDText); WarpIDText = new GeneralText(Position + Adjust * new asd.Vector2DF(0, Program.CellLarge), "→" + warp.InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(WarpIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); }
/// <summary> /// キーボードで反応するボタン的なのをつくる、便利だがくそコード /// </summary> /// <param name="text">ボタンのテキスト</param> /// <param name="pos">位置</param> /// <param name="width">幅</param> /// <param name="height">高さ</param> private Button(string text, asd.Vector2DF pos, int width, int height, int fontSize) { MovingSpeed = 12; Position = pos; ChildText = new GeneralText(new asd.Vector2DF(0, 0), text, fontSize, new asd.Color(2, 20, 20, 200), 2, new asd.Color(222, 222, 222, 200)); var rect = new asd.RectangleShape(); rect.DrawingArea = new asd.RectF(-width / 2, -height / 2, width, height); Back = new asd.GeometryObject2D(); Back.Shape = rect; AddChild(Back, asd.ChildManagementMode.RegistrationToLayer, asd.ChildTransformingMode.All); AddChild(ChildText, asd.ChildManagementMode.RegistrationToLayer, asd.ChildTransformingMode.All); }
public WarpZone(asd.Vector2DF pos, asd.Vector2DF warpPos) { InstanceID = GenerateID(); WarpID = InstanceID; WarpPos = warpPos; Position = pos; Texture = asd.Engine.Graphics.CreateTexture2D("WarpZone.png"); Color = new asd.Color(255, 255, 255, 90);//透明感出したい Scale = 1.2f * new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, (float)Program.CellLarge / (float)Texture.Size.Y); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); InstanceIDText = new GeneralText(Position - Adjust * new asd.Vector2DF(Program.CellLarge, Program.CellLarge), InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(InstanceIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); WarpIDText = new GeneralText(Position + Adjust * new asd.Vector2DF(0, Program.CellLarge), "→" + InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(WarpIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); }
protected override void OnRegistered() { asd.Layer2D layer = new asd.Layer2D(); AddLayer(layer); layer.AddObject(new BackGround()); string[,] buttonText = new string[, ] { { "音ON OFF" }, { "作る" }, { "遊ぶ" } }; Button.MakeButtonArray(layer, buttonText, 220, 50, 200, 200, 70, 30, 20); int textLarge = 2 * Program.CellLarge; String text = "圧倒的素材不足\n N E O!!"; var title = new GeneralText(new asd.Vector2DF(asd.Engine.WindowSize.X / 2, 4 * Program.CellLarge), text, textLarge, new asd.Color(2, 20, 20, 200), 5, new asd.Color(222, 222, 222, 200)); title.LineSpacing = -1.6f * Program.CellLarge; layer.AddObject(title); }
protected override void OnRegistered() { StageCount = -1; Layer = new asd.Layer2D(); AddLayer(Layer); Files = System.IO.Directory.GetFiles(Environment.CurrentDirectory + "\\", "*.xlsx", System.IO.SearchOption.AllDirectories); for (int i = 0; i < Files.Count(); i++) { Files[i] = Files[i].Replace(Environment.CurrentDirectory + "\\", "").Replace(".xlsx", ""); } if (Files.Count() == 0) { IsSceneChanging = true; String text = "ステージファイルが見つかりません\n"; var title = new GeneralText(new asd.Vector2DF(asd.Engine.WindowSize.X / 2, 4 * Program.CellLarge), text, 50, new asd.Color(2, 20, 20, 200), 5, new asd.Color(222, 222, 222, 200)); title.LineSpacing = -1.6f * Program.CellLarge; Layer.AddObject(new BackGround()); Layer.AddObject(title); asd.Engine.ChangeSceneWithTransition(new TitleScene(), new asd.TransitionFade(2.0f, 0.3f)); return; } ChangeStage(true); }
protected override void OnAdded() { MoveNum = new GeneralText(new asd.Vector2DF(27 * Program.CellLarge, 1 * Program.CellLarge), "総移動数" + PreStatus.Count().ToString(), Program.CellLarge / 2, new asd.Color(0, 0, 0, 0), Program.CellLarge / 6, new asd.Color(255, 255, 255, 0)); GeneralStage.TextLayer.AddObject(MoveNum); base.OnAdded(); }