protected override void OnAdded() { int counter = 0; foreach (KeyValuePair <string, Action> keyValuePair in keyValuePairs) { var text = new asd.TextObject2D() { Font = menuFont, Position = new asd.Vector2DF(buttonPos.X + 10, buttonPos.Y + 30 * counter), Text = keyValuePair.Key }; var object2D = new asd.GeometryObject2D() { Color = whi }; object2D.Shape = new asd.RectangleShape() { DrawingArea = new asd.RectF(buttonPos.X, buttonPos.Y + 30 * counter + 7, 200, 24), }; object2D.AddChild(text, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.All); buttons.Add(object2D); AddObject(object2D); counter++; } }
protected override void OnRegistered() { layer = new asd.Layer2D(); AddLayer(layer); // 下地 var background = new asd.GeometryObject2D(); layer.AddObject(background); var bgRect = new asd.RectangleShape(); bgRect.DrawingArea = new asd.RectF(0, 0, 1800, 1000); background.Shape = bgRect; foreach (var c in gameData.Battle.GetAliveCityList()) { var maps = c.GetMaps(); foreach (var m in maps) { m.AddLayer(layer); } } var info = Singleton.InfomationWindow; info.AddLayer(layer); var info2 = Singleton.GameProcessInfomation; info2.AddLayer(layer); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_CircleShape", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 円の図形クラスのインスタンスを生成する。 var arc = new asd.CircleShape(); // 円の外径、中心位置を指定する。 arc.OuterDiameter = 400; arc.Position = new asd.Vector2DF(320, 240); // 円を描画する図形として設定する。 geometryObj.Shape = arc; geometryObj.Color = new asd.Color(255, 255, 255, 255); // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_CircleShape", 30); } // Altseedを終了する。 asd.Engine.Terminate(); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_CircleShape", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 円の図形クラスのインスタンスを生成する。 var arc = new asd.CircleShape(); // 円の外径、中心位置を指定する。 arc.OuterDiameter = 400; arc.Position = new asd.Vector2DF(320, 240); // 円を描画する図形として設定する。 geometryObj.Shape = arc; // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_CircleShape", 30); } // Altseedを終了する。 asd.Engine.Terminate(); }
private static IControllerButton CreateButton(int index, float x, float y) { var defaultColor = new asd.Color(255, 255, 255); var hoverColor = new asd.Color(150, 150, 150); var holdColor = new asd.Color(50, 50, 50); var size = new asd.Vector2DF(150.0f, 150.0f); var buttonArea = new asd.RectF(-size / 2.0f, size); var buttonObj = new asd.GeometryObject2D() { Shape = new asd.RectangleShape() { DrawingArea = buttonArea } , Color = defaultColor , Position = asd.Engine.WindowSize.To2DF() / 2.0f + (new asd.Vector2DF(x, y)) } ; var button = new ControllerButtonComponent <asd.GeometryObject2D>("Button"); //button.DefaultEvent += owner => { }; //button.HoverEvent += owner => { }; //button.HoldEvent += owner => { }; button.OnEnteredEvent += owner => { Console.WriteLine("Button{0}: OnEntered", index); owner.Color = hoverColor; }; button.OnPushedEvent += owner => { Console.WriteLine("Button{0}: OnPushed", index); owner.Color = holdColor; }; button.OnReleasedEvent += owner => { Console.WriteLine("Button{0}: OnReleased", index); owner.Color = hoverColor; }; button.OnExitedEvent += owner => { Console.WriteLine("Button{0}: OnExited", index); owner.Color = defaultColor; }; buttonObj.AddComponent(button, button.Name); return(button); }
/// <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 void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_PolygonShape_Textured", 640, 480, new asd.EngineOption()); // テクスチャとして図形に合成する画像を読み込む。 var texture = asd.Engine.Graphics.CreateTexture2D("Data/Texture/Sample1.png"); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 多角形の図形クラスのインスタンスを生成する。 var polygon = new asd.PolygonShape(); // 多角形を構成する頂点を追加していく。(星形になるようにする。) for (int i = 0; i < 10; i++) { asd.Vector2DF vec = new asd.Vector2DF(1, 0); vec.Degree = i * 36; if (i % 2 == 0) { vec.Length = 200; } else { vec.Length = 75; } polygon.AddVertex(vec + new asd.Vector2DF(320, 240)); } // 多角形を描画する図形として設定し、合成するテクスチャも設定する。 geometryObj.Shape = polygon; geometryObj.Texture = texture; // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_PolygonShape_Textured", 30); } // Altseedを終了する。 asd.Engine.Terminate(); }
public void Draw(asd.Layer2D layer, float cameraN = 1) { var geometryObj = new asd.GeometryObject2D(); var arc = new asd.CircleShape(); arc.OuterDiameter = 8 * cameraN; arc.InnerDiameter = 0; arc.Position = pos; geometryObj.Shape = arc; geometryObj.Color = new asd.Color(255, 255, 0, 200); geometryObj.Position = new asd.Vector2DF(0, 0); layer.AddObject(geometryObj); }
public void Draw(asd.Layer2D layer) { var arc = new asd.CircleShape { OuterDiameter = radius * 2, Position = new asd.Vector2DF(center.x, center.y) }; var geometryObj = new asd.GeometryObject2D { Shape = arc, Color = new asd.Color(0, 0, 255), Position = new asd.Vector2DF(0, 0) }; layer.AddObject(geometryObj); }
static void Main(string[] args) { asd.Engine.Initialize("ShaderTest", 800, 600, new asd.EngineOption()); var obj = new TextureObject2DWithNormalMapping(); obj.Position = new asd.Vector2DF(100, 100); obj.Texture = asd.Engine.Graphics.CreateTexture2D("TestKomarigaoBumpGrayscale.png"); obj.NormalMap = asd.Engine.Graphics.CreateTexture2DAsRawData("TestKomarigaoNormalMap.png"); asd.Engine.AddObject2D(obj); var obj2 = new TextureObject2DWithNormalMapping(); obj2.Position = new asd.Vector2DF(300, 100); obj2.Texture = asd.Engine.Graphics.CreateTexture2D("Normal_map_example_with_scene_and_result.png"); obj2.NormalMap = asd.Engine.Graphics.CreateTexture2DAsRawData("Normal_map_example_with_scene_and_result2.png"); asd.Engine.AddObject2D(obj2); var geo = new asd.GeometryObject2D() { Shape = new asd.CircleShape() { InnerDiameter = 0, NumberOfCorners = 8, OuterDiameter = 16, }, Color = new asd.Color(255, 0, 0), DrawingPriority = 20, }; asd.Engine.AddObject2D(geo); while (asd.Engine.DoEvents()) { asd.Engine.Update(); var mp = asd.Engine.Mouse.Position; geo.Position = mp; var lv = new asd.Vector3DF(mp.X, mp.Y, 20); obj.LightSource = lv; obj.Angle += 0.1f; obj2.LightSource = lv; } asd.Engine.Terminate(); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_PolygonShape", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 多角形の図形クラスのインスタンスを生成する。 var polygon = new asd.PolygonShape(); // 多角形を構成する頂点を追加していく。(星形になるようにする。) for (int i = 0; i < 10; i++) { asd.Vector2DF vec = new asd.Vector2DF(1, 0); vec.Degree = i * 36; if (i % 2 == 0) { vec.Length = 200; } else { vec.Length = 75; } polygon.AddVertex(vec + new asd.Vector2DF(320, 240)); } // 多角形を描画する図形として設定する。 geometryObj.Shape = polygon; // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_PolygonShape", 30); } // Altseedの終了処理をする。 asd.Engine.Terminate(); }
public static void Main(string[] args) { asd.Engine.Initialize("Test", 640, 480, new asd.EngineOption()); PhysicAltseed.PhysicalConvert.PxPerMetreRate = 50; PhysicAltseed.PhysicalWorld world = new PhysicAltseed.PhysicalWorld(new asd.RectF(-200, -200, 1040, 880), new asd.Vector2DF(0, 250.0f)); asd.GeometryObject2D groundObject = new asd.GeometryObject2D(); PhysicAltseed.PhysicalRectangleShape ground = new PhysicAltseed.PhysicalRectangleShape(PhysicAltseed.PhysicalShapeType.Static, world); ground.DrawingArea = new asd.RectF(0, 430, 640, 50); ground.Friction = 0.8f; ground.Restitution = 0.0f; groundObject.Shape = ground; ground.CategoryBits = 0x0003; asd.Engine.AddObject2D(groundObject); asd.Engine.ProfilerIsVisible = true; while (asd.Engine.DoEvents()) { world.Update(); asd.Engine.Update(); if (asd.Engine.Mouse.LeftButton.ButtonState == asd.MouseButtonState.Push) { PhysicAltseed.PhysicalTextureObject2D physicalTextureObject = new PhysicAltseed.PhysicalTextureObject2D(PhysicAltseed.PhysicalShapeType.Dynamic, world); physicalTextureObject.Position = asd.Engine.Mouse.Position; physicalTextureObject.SetTexture("run_g0001.png"); physicalTextureObject.CollisionShape.Friction = 0.8f; physicalTextureObject.CollisionShape.Restitution = 0.2f; physicalTextureObject.CollisionShape.Density = 1.0f; physicalTextureObject.CollisionShape.CategoryBits = 0x0001; physicalTextureObject.CollisionShape.MaskBits = 0x0001; physicalTextureObject.Color = new asd.Color(255, 100, 100); asd.Engine.AddObject2D(physicalTextureObject); } if (asd.Engine.Mouse.RightButton.ButtonState == asd.MouseButtonState.Push) { var remove = asd.Engine.CurrentScene.Layers.OfType <asd.Layer2D>().First().Objects.OfType <PhysicAltseed.PhysicalTextureObject2D>().First(); remove.CollisionShape.IsActive = false; remove.CollisionShape.Dispose(); remove.Dispose(); } } asd.Engine.Terminate(); }
private void button_Click(object sender, RoutedEventArgs e) { // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 円の図形クラスのインスタンスを生成する。 var arc = new asd.CircleShape(); // 円の外径、中心位置を指定する。 arc.OuterDiameter = 400; arc.Position = new asd.Vector2DF(320, 240); // 円を描画する図形として設定する。 geometryObj.Shape = arc; }
public Message() { var obj = new asd.GeometryObject2D(); var rect = new asd.RectangleShape(); // TODO rect.DrawingArea = new asd.RectF(-300, -80, 600, 160); obj.Shape = rect; obj.Position = new asd.Vector2DF(320, 390); obj.Color = new asd.Color(50, 50, 150); AddObject(obj); messageLabel.Font = Resource.Font; messageLabel.Position = obj.Position + new asd.Vector2DF(-300, -80) + new asd.Vector2DF(32, 32); AddObject(messageLabel); IsUpdated = false; IsDrawn = false; }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_PolygonShape_Textured", 640, 480, new asd.EngineOption()); // テクスチャとして図形に合成する画像を読み込む。 var texture = asd.Engine.Graphics.CreateTexture2D("Data/Texture/Sample1.png"); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 多角形の図形クラスのインスタンスを生成する。 var polygon = new asd.PolygonShape(); // 多角形を構成する頂点を追加していく。(星形になるようにする。) for (int i = 0; i < 10; ++i) { asd.Vector2DF vec = new asd.Vector2DF(1, 0); vec.Degree = i * 36; vec.Length = (i % 2 == 0) ? 200 : 75; polygon.AddVertex(vec + new asd.Vector2DF(320, 240)); } // 多角形を描画する図形として設定し、合成するテクスチャも設定する。 geometryObj.Shape = polygon; geometryObj.Texture = texture; // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_PolygonShape_Textured", 30); } // Altseedを終了する。 asd.Engine.Terminate(); }
public TextArea() { var obj = new asd.GeometryObject2D(); var rect = new asd.RectangleShape(); rect.DrawingArea = new asd.RectF(-Size / 2, Size); obj.Shape = rect; obj.CenterPosition = Resource.Window.Size.To2DF() / 2; obj.Position = Resource.Window.Size.To2DF() / 2 + new asd.Vector2DF(0, 120); obj.Color = new asd.Color(255, 255, 0); AddObject(obj); nameLabel.Font = Resource.Font; nameLabel.Position = obj.Position - Size / 2 + new asd.Vector2DF(16, 16); AddObject(nameLabel); textLabel.Font = Resource.Font; textLabel.Position = obj.Position - Size / 2 + new asd.Vector2DF(32, 48); AddObject(textLabel); }
public void Run() { // aceを初期化する asd.Engine.Initialize("GeometryObject2D_ArcShape", 640, 480, new asd.EngineOption()); var texture = asd.Engine.Graphics.CreateTexture2D("Data/Texture/Sample1.png"); //図形描画クラスのコンストラクタを呼び出す var geometryObj = new asd.GeometryObject2D(); //図形描画クラスをレイヤーに追加する。 asd.Engine.AddObject2D(geometryObj); //弧を図形描画クラス1にて描画する。 { //弧の外径、内径、頂点数、中心位置、開始頂点番号、終了頂点番号を指定。 var arc = new asd.ArcShape(); arc.OuterDiameter = 100; arc.InnerDiameter = 10; arc.NumberOfCorners = 96; arc.Position = new asd.Vector2DF(300, 100); arc.StartingCorner = 90; arc.EndingCorner = 5; //弧を描画する図形として設定し、合成するテクスチャも設定。 geometryObj.Shape = arc; geometryObj.Texture = texture; geometryObj.Position = new asd.Vector2DF(0, 0); } // aceが進行可能かチェックする。 while (asd.Engine.DoEvents()) { // aceを更新する。 asd.Engine.Update(); } // aceを終了する。 asd.Engine.Terminate(); }
public Dialog() { _dialog = new asd.GeometryObject2D(); _dialog.Color = new asd.Color(255, 255, 255); var dialogRect = new asd.RectangleShape(); dialogRect.DrawingArea = new asd.RectF(300, 400, 600, 200); _dialog.Shape = dialogRect; _valueText = new asd.TextObject2D(); _valueText.Position = new asd.Vector2DF(310, 410); _valueText.Font = Singleton.Font; _okButton = new asd.TextureObject2D(); _okButton.Texture = Singleton.ImageOK; _okButton.Position = new asd.Vector2DF(310, 500); _cancelButton = new asd.TextureObject2D(); _cancelButton.Texture = Singleton.ImageCancel; _cancelButton.Position = new asd.Vector2DF(620, 500); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_PolygonShape", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 多角形の図形クラスのインスタンスを生成する。 var polygon = new asd.PolygonShape(); // 多角形を構成する頂点を追加していく。(星形になるようにする。) for (int i = 0; i < 10; ++i) { asd.Vector2DF vec = new asd.Vector2DF(1, 0); vec.Degree = i * 36; vec.Length = (i % 2 == 0) ? 200 : 75; polygon.AddVertex(vec + new asd.Vector2DF(320, 240)); } // 多角形を描画する図形として設定する。 geometryObj.Shape = polygon; // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_PolygonShape", 30); } // Altseedの終了処理をする。 asd.Engine.Terminate(); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("GeometryObject2D_ArcShape", 640, 480, new asd.EngineOption()); // 図形描画クラスのコンストラクタを呼び出す。 var geometryObj = new asd.GeometryObject2D(); // 図形描画オブジェクトのインスタンスをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj); // 弧の図形クラスのインスタンスを生成する。 var arc = new asd.ArcShape(); // 弧の外径、内径、頂点数、中心位置、開始頂点番号、終了頂点番号を指定する。 arc.OuterDiameter = 400; arc.InnerDiameter = 40; arc.NumberOfCorners = 96; arc.Position = new asd.Vector2DF(320, 240); arc.StartingCorner = 90; arc.EndingCorner = 45; // 弧を描画する図形として設定する。 geometryObj.Shape = arc; // Altseedを更新する。 while (asd.Engine.DoEvents()) { // Altseedを更新する。 asd.Engine.Update(); Recorder.TakeScreenShot("GeometryObject2D_ArcShape", 30); } // Altseedの終了処理をする。 asd.Engine.Terminate(); }
protected override void OnStart() { var scene = new asd.Scene(); var layer = new asd.Layer2D(); var texture = asd.Engine.Graphics.CreateTexture2D("Data/Texture/Sample1.png"); var geometryObj1 = new asd.GeometryObject2D(); var geometryObj2 = new asd.GeometryObject2D(); var geometryObj3 = new asd.GeometryObject2D(); var geometryObj4 = new asd.GeometryObject2D(); var geometryObj5 = new asd.GeometryObject2D(); var geometryObj6 = new asd.GeometryObject2D(); layer.AddObject(geometryObj1); layer.AddObject(geometryObj2); layer.AddObject(geometryObj3); layer.AddObject(geometryObj4); layer.AddObject(geometryObj5); layer.AddObject(geometryObj6); scene.AddLayer(layer); asd.Engine.ChangeScene(scene); { var circle = new asd.CircleShape(); circle.OuterDiameter = 100.0f; circle.InnerDiameter = 10.0f; circle.NumberOfCorners = 96; circle.Position = new asd.Vector2DF(100, 50); geometryObj1.Shape = circle; geometryObj1.Texture = texture; geometryObj1.Position = new asd.Vector2DF(0, 0); } { var arc = new asd.ArcShape(); arc.OuterDiameter = 100; arc.InnerDiameter = 10; arc.NumberOfCorners = 96; arc.Position = new asd.Vector2DF(300, 50); arc.StartingCorner = 90; arc.EndingCorner = 5; geometryObj2.Shape = arc; geometryObj2.Texture = texture; geometryObj2.Position = new asd.Vector2DF(0, 0); } { var line = new asd.LineShape(); line.StartingPosition = new asd.Vector2DF(410, 50); line.EndingPosition = new asd.Vector2DF(630, 50); line.Thickness = 5.0f; geometryObj3.Shape = line; geometryObj3.Position = new asd.Vector2DF(0, 0); } { var rect = new asd.RectangleShape(); rect.DrawingArea = new asd.RectF(10, 110, 300, 200); rect.UV = new asd.RectF(0.0f, 0.0f, 0.5f, 0.5f); geometryObj4.Shape = rect; geometryObj4.Texture = texture; geometryObj4.Position = new asd.Vector2DF(0, 0); } { var triangle = new asd.TriangleShape(); triangle.SetPointByIndex(new asd.Vector2DF(320, 350), 0); triangle.SetPointByIndex(new asd.Vector2DF(100, 450), 1); triangle.SetPointByIndex(new asd.Vector2DF(540, 450), 2); triangle.SetUVByIndex(new asd.Vector2DF(0.5f, 0.2f), 0); triangle.SetUVByIndex(new asd.Vector2DF(0.1f, 0.5f), 1); triangle.SetUVByIndex(new asd.Vector2DF(0.9f, 0.7f), 2); geometryObj5.Shape = triangle; geometryObj5.Texture = texture; geometryObj5.Position = new asd.Vector2DF(0, 0); } { var polygon = new asd.PolygonShape(); for (int i = 0; i < 10; ++i) { asd.Vector2DF vec = new asd.Vector2DF(1, 0); vec.Degree = i * 36; vec.Length = (i % 2 == 0) ? 100 : 55; polygon.AddVertex(vec + new asd.Vector2DF(500, 250)); } geometryObj6.Shape = polygon; geometryObj6.Texture = texture; geometryObj6.Position = new asd.Vector2DF(0, 0); } }
public void Run() { asd.Engine.Initialize("ピクロス解析ツール", 1800, 1000, new asd.EngineOption()); // 下地 var background = new asd.GeometryObject2D(); asd.Engine.AddObject2D(background); var bgRect = new asd.RectangleShape(); bgRect.DrawingArea = new asd.RectF(0, 0, 1800, 1000); background.Shape = bgRect; // 数字の入力するマス for (int row = 0; row < 10; row++) { NumberSquare square = new NumberSquare(row, -1); square.SetValue("0"); asd.Engine.AddObject2D(square.getBackTexture()); asd.Engine.AddObject2D(square.getTextObject()); List <NumberSquare> rowList = new List <NumberSquare>(); rowList.Add(square); rowNumberSquare.Add(rowList); } for (int col = 0; col < 10; col++) { NumberSquare square = new NumberSquare(-1, col); square.SetValue("0"); asd.Engine.AddObject2D(square.getBackTexture()); asd.Engine.AddObject2D(square.getTextObject()); List <NumberSquare> colList = new List <NumberSquare>(); colList.Add(square); colNumberSquare.Add(colList); } // 色を塗るマス for (int row = 0; row < 10; row++) { List <DrawSquare> rowList = new List <DrawSquare>(); for (int col = 0; col < 10; col++) { var square = new DrawSquare(row, col); asd.Engine.AddObject2D(square.getBackTexture()); rowList.Add(square); } drawSquares.Add(rowList); } // サイズ変更ダイアログ Dialog dialog = new Dialog(); dialog.SetEngine(); dialog.SetAction(() => { dialog.Hide(); int row = dialog.GetRowValue(); int col = dialog.GetColValue(); while (row != drawSquares.Count) { if (drawSquares.Count > row) { deleteRow(); deleteRowNumber(); } else { addRow(); addRowNumber(); } } while (col != drawSquares[0].Count) { if (drawSquares[0].Count > col) { deleteCol(); deleteColNumber(); } else { addCol(); addColNumber(); } } }); // パレット Palette palette = new Palette(); palette.SetEngine(); palette.Hide(); // サイズ変更ボタン List <Button> buttons = new List <Button>(); var sizeButton = new Button(10, 10, "サイズ変更"); sizeButton.Show(); asd.Engine.AddObject2D(sizeButton.getBackTexture()); asd.Engine.AddObject2D(sizeButton.getTextObject()); buttons.Add(sizeButton); sizeButton.SetAction(() => { dialog.Show(); }); // 解析ボタン var anlyzeButton = new Button(10, 50, "解析"); anlyzeButton.Show(); asd.Engine.AddObject2D(anlyzeButton.getBackTexture()); asd.Engine.AddObject2D(anlyzeButton.getTextObject()); buttons.Add(anlyzeButton); anlyzeButton.SetAction(() => { PicrossAnalyze picross = new PicrossAnalyze(rowNumberSquare, colNumberSquare); var ret = picross.Run(); for (int row = 0; row < rowNumberSquare.Count; row++) { for (int col = 0; col < colNumberSquare.Count; col++) { if (ret[row, col].IsPainted()) { drawSquares[row][col].Paint(); } else if (ret[row, col].IsMasked()) { drawSquares[row][col].Mask(); } } } }); // セーブボタン var saveButton = new Button(10, 90, "セーブ"); saveButton.Show(); asd.Engine.AddObject2D(saveButton.getBackTexture()); asd.Engine.AddObject2D(saveButton.getTextObject()); buttons.Add(saveButton); saveButton.SetAction(() => { FileAccess.Save(rowNumberSquare, colNumberSquare); }); // ロードボタン var loadButton = new Button(10, 130, "ロード"); loadButton.Show(); asd.Engine.AddObject2D(loadButton.getBackTexture()); asd.Engine.AddObject2D(loadButton.getTextObject()); buttons.Add(loadButton); loadButton.SetAction(() => { FileAccess.Load(ref rowNumberSquare, ref colNumberSquare); int row = rowNumberSquare.Count(); int col = colNumberSquare.Count(); while (row != drawSquares.Count) { if (drawSquares.Count > row) { deleteRow(); } else { addRow(); } } while (col != drawSquares[0].Count) { if (drawSquares[0].Count > col) { deleteCol(); } else { addCol(); } } }); while (asd.Engine.DoEvents()) { asd.Vector2DF pos = asd.Engine.Mouse.Position; if (!dialog.IsShow()) { if (!palette.IsShow()) { foreach (var rowList in rowNumberSquare) { foreach (var s in rowList) { s.UpdateTexture(pos); } } foreach (var colList in colNumberSquare) { foreach (var s in colList) { s.UpdateTexture(pos); } } foreach (Button button in buttons) { button.UpdateTexture(pos); } } else { palette.UpdateTexture(pos); } } else { dialog.UpdateTexture(pos); } if (asd.Engine.Mouse.LeftButton.ButtonState == asd.ButtonState.Push) { if (!dialog.IsShow()) { if (!palette.IsShow()) { int rowIndex; int colIndex; rowIndex = 0; foreach (var rowList in rowNumberSquare) { colIndex = -1; foreach (var s in rowList) { if (s.IsClick(pos)) { selectedNumberSquare = s; selectedRowIndex = rowIndex; selectedColIndex = colIndex; palette.Show(pos, selectedNumberSquare.GetValue().ToString()); } colIndex--; } rowIndex++; } colIndex = 0; foreach (var colList in colNumberSquare) { rowIndex = -1; foreach (var s in colList) { if (s.IsClick(pos)) { selectedNumberSquare = s; selectedRowIndex = rowIndex; selectedColIndex = colIndex; palette.Show(pos, selectedNumberSquare.GetValue().ToString()); } rowIndex--; } colIndex++; } foreach (Button button in buttons) { if (button.IsClick(pos)) { button.OnClick(); } } } else { if (palette.IsClick(pos)) { string value = string.Empty; palette.OnClick(pos); if (palette.IsClickEnter()) { palette.Hide(); if (selectedNumberSquare != null) { selectedNumberSquare.SetValue(palette.GetValue()); if (selectedNumberSquare.GetStringValue() != string.Empty) { if (selectedRowIndex >= 0) { if (Math.Abs(selectedColIndex - 1) > rowNumberSquare[selectedRowIndex].Count) { var square = new NumberSquare(selectedRowIndex, selectedColIndex - 1); asd.Engine.AddObject2D(square.getBackTexture()); asd.Engine.AddObject2D(square.getTextObject()); rowNumberSquare[selectedRowIndex].Add(square); } } else if (selectedColIndex >= 0) { if (Math.Abs(selectedRowIndex - 1) > colNumberSquare[selectedColIndex].Count) { var square = new NumberSquare(selectedRowIndex - 1, selectedColIndex); asd.Engine.AddObject2D(square.getBackTexture()); asd.Engine.AddObject2D(square.getTextObject()); colNumberSquare[selectedColIndex].Add(square); } } } else { if (selectedRowIndex >= 0) { if (Math.Abs(selectedColIndex - 1) <= rowNumberSquare[selectedRowIndex].Count) { asd.Engine.RemoveObject2D(rowNumberSquare[selectedRowIndex][Math.Abs(selectedColIndex + 1)].getBackTexture()); asd.Engine.RemoveObject2D(rowNumberSquare[selectedRowIndex][Math.Abs(selectedColIndex + 1)].getTextObject()); rowNumberSquare[selectedRowIndex].RemoveAt(Math.Abs(selectedColIndex + 1)); for (int col = selectedColIndex + 1; Math.Abs(col) < rowNumberSquare[selectedRowIndex].Count; col--) { rowNumberSquare[selectedRowIndex][Math.Abs(col)].SetPosition(selectedRowIndex, col - 1); } } } else if (selectedColIndex >= 0) { if (Math.Abs(selectedRowIndex - 1) <= colNumberSquare[selectedColIndex].Count) { asd.Engine.RemoveObject2D(colNumberSquare[selectedColIndex][Math.Abs(selectedRowIndex + 1)].getBackTexture()); asd.Engine.RemoveObject2D(colNumberSquare[selectedColIndex][Math.Abs(selectedRowIndex + 1)].getTextObject()); colNumberSquare[selectedColIndex].RemoveAt(Math.Abs(selectedRowIndex + 1)); for (int row = selectedRowIndex + 1; Math.Abs(row) < colNumberSquare[selectedColIndex].Count; row--) { colNumberSquare[selectedColIndex][Math.Abs(row)].SetPosition(row - 1, selectedColIndex); } } } selectedNumberSquare.SetValue("0"); } selectedNumberSquare = null; } } } else { palette.Hide(); } } } else { dialog.OnClick(pos); } } asd.Engine.Update(); } asd.Engine.Terminate(); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("Collision2D_Basic", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 asd.GeometryObject2D geometryObj0 = new asd.GeometryObject2D(); asd.GeometryObject2D geometryObj1 = new asd.GeometryObject2D(); // マウスによって動かす円。 asd.CircleShape selfCircle; // 停止している円。 asd.CircleShape circle; // 図形描画オブジェクトをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj0); asd.Engine.AddObject2D(geometryObj1); // マウスによって動かす円の形状と描画の設定を行う。 { // 円の外径を指定する。 selfCircle = new asd.CircleShape(); selfCircle.OuterDiameter = 100; // マウスによって動かす円を描画する図形として設定する。 geometryObj0.Shape = selfCircle; } // 停止している円の形状と描画の設定を行う。 { // 円の外径、内径、頂点数、中心位置を指定する。 circle = new asd.CircleShape(); circle.OuterDiameter = 100; circle.Position = new asd.Vector2DF(100, 100); // 停止している円を描画する図形として設定する。 geometryObj1.Shape = circle; } // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // マウスによって制御される円の中心位置をマウスの位置とする。 selfCircle.Position = asd.Engine.Mouse.Position; // 固定されている円に、マウスによって動く円が衝突した時に円を赤く変化させる。 // そうでない時は白く変化させる。 if (selfCircle.GetIsCollidedWith(circle)) { geometryObj0.Color = new asd.Color(255, 0, 0, 255); } else { geometryObj0.Color = new asd.Color(255, 255, 255, 255); } Recorder.CaptureScreen("Collision2D_Basic", 30, 60, 0.5f, 0.5f); // Altseedを更新する。 asd.Engine.Update(); } // Altseedの終了処理をする。 asd.Engine.Terminate(); }
protected override void OnRegistered() { var layer = new asd.Layer2D(); AddLayer(layer); // 下地 var background = new asd.GeometryObject2D(); layer.AddObject(background); var bgRect = new asd.RectangleShape(); bgRect.DrawingArea = new asd.RectF(0, 0, 1800, 1000); background.Shape = bgRect; var label = new asd.TextObject2D(); label.Font = Singleton.LargeFont; label.Text = "VS"; label.Position = new asd.Vector2DF(470, 400); layer.AddObject(label); var attackCityLabel = new asd.TextObject2D(); attackCityLabel.Font = Singleton.LargeFont; attackCityLabel.Text = _attack.Name; attackCityLabel.Position = new asd.Vector2DF(450, 650); layer.AddObject(attackCityLabel); var deffenceCityLabel = new asd.TextObject2D(); deffenceCityLabel.Font = Singleton.LargeFont; deffenceCityLabel.Text = _deffence.Name; deffenceCityLabel.Position = new asd.Vector2DF(450, 150); layer.AddObject(deffenceCityLabel); _attackParam = new asd.TextObject2D(); _attackParam.Font = Singleton.LargeFont; _attackParam.Text = "戦闘力:" + _attackPower; _attackParam.Position = new asd.Vector2DF(700, 650); layer.AddObject(_attackParam); _deffenceParam = new asd.TextObject2D(); _deffenceParam.Font = Singleton.LargeFont; _deffenceParam.Text = "戦闘力:" + _deffencePower; _deffenceParam.Position = new asd.Vector2DF(700, 150); layer.AddObject(_deffenceParam); _image_gu_attack = new BattleIcon(BattleIcon.Icon.Gu, BattleIcon.Position.Attack); _image_gu_attack.AddLayer(layer); _image_gu_attack.Hide(); _image_choki_attack = new BattleIcon(BattleIcon.Icon.Choki, BattleIcon.Position.Attack); _image_choki_attack.AddLayer(layer); _image_choki_attack.Hide(); _image_par_attack = new BattleIcon(BattleIcon.Icon.Par, BattleIcon.Position.Attack); _image_par_attack.AddLayer(layer); _image_par_attack.Hide(); _image_gu_deffence = new BattleIcon(BattleIcon.Icon.Gu, BattleIcon.Position.Deffence); _image_gu_deffence.AddLayer(layer); _image_gu_deffence.Hide(); _image_choki_deffence = new BattleIcon(BattleIcon.Icon.Choki, BattleIcon.Position.Deffence); _image_choki_deffence.AddLayer(layer); _image_choki_deffence.Hide(); _image_par_deffence = new BattleIcon(BattleIcon.Icon.Par, BattleIcon.Position.Deffence); _image_par_deffence.AddLayer(layer); _image_par_deffence.Hide(); _attackResult = new BattleIcon(BattleIcon.Icon.Choki, BattleIcon.Position.Attack); _attackResult.AddLayer(layer); _attackResult.Hide(); _deffenceResult = new BattleIcon(BattleIcon.Icon.Choki, BattleIcon.Position.Deffence); _deffenceResult.AddLayer(layer); _deffenceResult.Hide(); }
public void Run() { // Altseedを初期化する。 asd.Engine.Initialize("Collision2D_Geometries", 640, 480, new asd.EngineOption()); // 図形描画オブジェクトのインスタンスを生成する。 asd.GeometryObject2D geometryObj0 = new asd.GeometryObject2D(); asd.GeometryObject2D geometryObj1 = new asd.GeometryObject2D(); asd.GeometryObject2D geometryObj2 = new asd.GeometryObject2D(); asd.GeometryObject2D geometryObj3 = new asd.GeometryObject2D(); // マウスによって動かす円。 asd.CircleShape selfCircle; // 停止している円、三角形、矩形。 asd.CircleShape circle; asd.TriangleShape triangle; asd.RectangleShape rect; // 図形描画オブジェクトをエンジンに追加する。 asd.Engine.AddObject2D(geometryObj0); asd.Engine.AddObject2D(geometryObj1); asd.Engine.AddObject2D(geometryObj2); asd.Engine.AddObject2D(geometryObj3); // マウスによって動かす円の形状と描画の設定を行う。 { // 円の外径を指定する。 selfCircle = new asd.CircleShape(); selfCircle.OuterDiameter = 100; // マウスによって動かす円を描画する図形として設定する。 geometryObj0.Shape = selfCircle; } // 停止している円の形状と描画の設定を行う。 { // 円の外径、中心位置を指定する。 circle = new asd.CircleShape(); circle.OuterDiameter = 100; circle.Position = new asd.Vector2DF(400, 100); // 円を描画する図形として設定する。 geometryObj1.Shape = circle; } // 停止している三角形の形状と描画の設定を行う。 { // 三角形の各頂点の位置を指定する。 triangle = new asd.TriangleShape(); triangle.SetPointByIndex(new asd.Vector2DF(440, 350), 0); triangle.SetPointByIndex(new asd.Vector2DF(340, 450), 1); triangle.SetPointByIndex(new asd.Vector2DF(580, 450), 2); // 停止している三角形を描画する図形として設定する。 geometryObj2.Shape = triangle; } // 停止している矩形の形状と描画の設定を行う。 { rect = new asd.RectangleShape(); rect.DrawingArea = new asd.RectF(70, 110, 300, 200); rect.Angle = 15; // 停止している矩形を描画する図形として設定する。 geometryObj3.Shape = rect; } // Altseedのウインドウが閉じられていないか確認する。 while (asd.Engine.DoEvents()) { // マウスによって制御される円の中心位置をマウスの位置とする。 selfCircle.Position = asd.Engine.Mouse.Position; // 停止している円・三角形・矩形のいずれかに、マウスによって動く円が衝突した時に円を赤く変化させる。 // そうでない時は白く変化させる。 if (selfCircle.GetIsCollidedWith(circle) || selfCircle.GetIsCollidedWith(triangle) || selfCircle.GetIsCollidedWith(rect)) { geometryObj0.Color = new asd.Color(255, 0, 0, 255); } else { geometryObj0.Color = new asd.Color(255, 255, 255, 255); } Recorder.CaptureScreen("Collision2D_Geometries", 30, 120, 0.5f, 0.5f); // Altseedを更新する。 asd.Engine.Update(); } // Altseedの終了処理をする。 asd.Engine.Terminate(); }
/// <summary> /// マップのロード /// </summary> /// <param name="mapIO">マップデータ</param> /// <param name="initDoorID">初期ドアID</param> /// <param name="initSavePointID">初期セーブポイント</param> /// <param name="loader">ロードするオブジェクト</param> /// <returns></returns> public async Task LoadMapData(SatIO.MapIO mapIO, int initDoorID, int initSavePointID, ILoader loader) { //背景 foreach (var item in mapIO.BackGrounds) { var backGround = await BackGround.CreateBackGroudAsync(item); AddObject(backGround); loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } //物理世界構築 PhysicalWorld = new PhysicalWorld(new asd.RectF(new asd.Vector2DF(-200, -200), mapIO.Size + new asd.Vector2DF(200, 200) * 2), new asd.Vector2DF(0, 8000)); //カメラ設定 { PlayerCamera = new ScrollCamera(mapIO.CameraRestrictions); PlayerCamera.HomingObject = Player; PlayerCamera.Src = new asd.RectI(0, 0, (int)OriginDisplaySize.X, (int)OriginDisplaySize.Y); PlayerCamera.MapSize = mapIO.Size; AddObject(PlayerCamera); Camera.IsDrawn = false; Camera.IsUpdated = false; } //障害物 foreach (var item in mapIO.CollisionBoxes) { PhysicalRectangleShape temp = new PhysicalRectangleShape(PhysicalShapeType.Static, PhysicalWorld); temp.Density = 1; temp.Restitution = 0; temp.Friction = 0; temp.DrawingArea = new asd.RectF(item.Position, item.Size); Obstacles.Add(temp); loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); #if DEBUG asd.GeometryObject2D geometryObject = new asd.GeometryObject2D(); geometryObject.Shape = temp; geometryObject.Color = new asd.Color(0, 0, 255, 100); geometryObject.DrawingPriority = 2; AddObject(geometryObject); #endif } foreach (var item in mapIO.CollisionTriangles) { PhysicalTriangleShape temp = new PhysicalTriangleShape(PhysicalShapeType.Static, PhysicalWorld); temp.Density = 1; temp.Restitution = 0; temp.Friction = 0; var i = 0; foreach (var vertex in item.vertexes) { temp.SetPointByIndex(vertex, i); i++; } Obstacles.Add(temp); loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); #if DEBUG asd.GeometryObject2D geometryObject = new asd.GeometryObject2D(); geometryObject.Shape = temp; geometryObject.Color = new asd.Color(0, 0, 255, 100); geometryObject.DrawingPriority = 2; AddObject(geometryObject); #endif } //ドア var tempDoors = new List <Door>(); foreach (var item in mapIO.Doors) { var door = await Door.CreateDoorAsync(item); door.OnLeave += OnLeave; AddObject(door); tempDoors.Add(door); loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } //マップオブジェクト foreach (var item in mapIO.MapObjects) { try { var mapObject = await MapObject.CreateMapObjectAsync(item); AddObject(mapObject); } catch (Exception e) { Logger.Error(e); } loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } //イベントオブジェクト List <IActor> actors = new List <IActor>(GameScene.Players); foreach (var item in mapIO.EventObjects) { try { var eventObject = await EventObject.CreateEventObjectAsync(item); AddObject(eventObject); actors.Add(eventObject); } catch (Exception e) { Logger.Error(e); } loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } //イベント if (Scene is GameScene gameScene) { foreach (var item in mapIO.MapEvents) { if (GameScene.EndEvents.Any(obj => obj.Key == gameScene.MapPath && obj.Value == item.ID)) { continue; } try { bool isSkip = false; foreach (var item2 in item.Actors.Where(obj => obj.Path != null && obj.Path.IndexOf(".pc") > -1)) { if (!gameScene.CanUsePlayers.Any(obj => obj.Path == item2.Path)) { isSkip = true; break; } } if (isSkip) { continue; } Object.MapEvent.MapEvent temp = await Object.MapEvent.MapEvent.CreateMapEventAsync(item, actors, PlayerCamera); AddObject(temp); } catch (Exception e) { Logger.Error(e); } loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } } //セーブポイント List <SavePoint> tempSavePoints = new List <SavePoint>(); foreach (var item in mapIO.SavePoints) { SavePoint savePoint = new SavePoint(item); AddObject(savePoint); tempSavePoints.Add(savePoint); loader.ProgressInfo = (loader.ProgressInfo.taskCount, loader.ProgressInfo.progress + 1); } //プレイヤー初期配置 if (initSavePointID != -1 && tempSavePoints.FirstOrDefault(savePoint => savePoint.ID == initSavePointID) != null) { Player.Position = tempSavePoints.FirstOrDefault(savePoint => savePoint.ID == initSavePointID).Position; } else if (initDoorID != -1 && tempDoors.FirstOrDefault(door => door.ID == initDoorID) != null) { Door door = tempDoors.FirstOrDefault(obj => obj.ID == initDoorID); Player.Position = door.Position; door.Come(); } return; }
public GameMgr(int bestscore, bool isrestart) { //レイヤー登録 { LayerOfBackGround = new asd.Layer2D(); AddLayer(LayerOfBackGround); LayerOfBackGround_A = new asd.Layer2D(); AddLayer(LayerOfBackGround_A); LayerOfMain = new asd.Layer2D(); AddLayer(LayerOfMain); CameraOfMain = new asd.CameraObject2D(); CameraOfMain.Src = new asd.RectI(0, 0, asd.Engine.WindowSize.X, asd.Engine.WindowSize.Y); CameraOfMain.Dst = new asd.RectI(0, 0, asd.Engine.WindowSize.X, asd.Engine.WindowSize.Y); LayerOfMain.AddObject(CameraOfMain); LayerOfStatus = new asd.Layer2D(); AddLayer(LayerOfStatus); } //オブジェクト配置 //背景 { BackGround = new asd.TextureObject2D(); BackGround.Texture = asd.Engine.Graphics.CreateTexture2D("Image/BackGround.png"); LayerOfBackGround.AddObject(BackGround); BackGround_A = new asd.MapObject2D(); for (int i = 0; i < 200; i++) { asd.Chip2D chip = new asd.Chip2D(); chip.Texture = asd.Engine.Graphics.CreateTexture2D("Image/Back_A.png"); chip.Position = new asd.Vector2DF(i * 640.0f, 0.0f); BackGround_A.AddChip(chip); } CameraOfBackGround_A = new asd.CameraObject2D(); CameraOfBackGround_A.Src = new asd.RectI(0, 0, 640, 480); CameraOfBackGround_A.Dst = new asd.RectI(0, 0, 640, 480); LayerOfBackGround_A.AddObject(BackGround_A); LayerOfBackGround_A.AddObject(CameraOfBackGround_A); } //メイン { Airplane = new Player(); LayerOfMain.AddObject(Airplane); BestScoreLine = new asd.GeometryObject2D(); BoxOfBestScore = new asd.RectangleShape(); BoxOfBestScore.DrawingArea = new asd.RectF(bestscore * 50.0f, 0, 5, 480); BestScoreLine.Shape = BoxOfBestScore; BestScoreLine.Color = new asd.Color(255, 255, 0); BestScoreLine.DrawingPriority = 3; LayerOfMain.AddObject(BestScoreLine); Walls = new List <Wall>(); Clouds = new List <Cloud>(); Rains = new List <Rain>(); Healers = new List <Healer>(); Winds = new List <Wind>(); } //ステータス { HPBar = new asd.GeometryObject2D(); BoxOfHPBar = new asd.RectangleShape(); BoxOfHPBar.DrawingArea = new asd.RectF(120, 440, Airplane.HP / Airplane.MaxHP * WidthOfHPBar, 20); HPBar.Shape = BoxOfHPBar; HPBar.Color = new asd.Color(255, 255, 255, 100); TextOfHP = new asd.TextObject2D(); TextOfHP.Font = asd.Engine.Graphics.CreateDynamicFont("", 20, new asd.Color(255, 255, 255, 100), 0, new asd.Color(255, 255, 255, 100)); TextOfHP.Text = "HP"; TextOfHP.Color = new asd.Color(255, 255, 255, 100); TextOfHP.CenterPosition = TextOfHP.Font.CalcTextureSize(TextOfHP.Text, asd.WritingDirection.Horizontal).To2DF() / 2.0f; TextOfHP.Position = new asd.Vector2DF(70.0f, 450.0f); TextOfScore = new asd.TextObject2D(); TextOfScore.Font = asd.Engine.Graphics.CreateDynamicFont("", 20, new asd.Color(255, 255, 255), 0, new asd.Color(0, 0, 0)); TextOfScore.Text = "SCORE : 0"; TextOfScore.Position = new asd.Vector2DF(10.0f, 10.0f); LayerOfStatus.AddObject(HPBar); LayerOfStatus.AddObject(TextOfHP); LayerOfStatus.AddObject(TextOfScore); } //スタート { LayerOfStart = new asd.Layer2D(); TextOfTitle = new asd.TextObject2D(); TextOfTitle.Font = asd.Engine.Graphics.CreateDynamicFont("", 60, new asd.Color(255, 255, 255), 0, new asd.Color(255, 255, 255)); TextOfTitle.Text = "KAMI HIKOKI"; TextOfTitle.CenterPosition = TextOfTitle.Font.CalcTextureSize(TextOfTitle.Text, asd.WritingDirection.Horizontal).To2DF() / 2.0f; TextOfTitle.Position = new asd.Vector2DF(asd.Engine.WindowSize.X / 2.0f, asd.Engine.WindowSize.Y / 2.0f); TextOfPAK = new asd.TextObject2D(); TextOfPAK.Font = asd.Engine.Graphics.CreateDynamicFont("", 20, new asd.Color(255, 255, 255), 0, new asd.Color(255, 255, 255)); TextOfPAK.Text = "Press Any Key"; TextOfPAK.CenterPosition = TextOfPAK.Font.CalcTextureSize(TextOfPAK.Text, asd.WritingDirection.Horizontal).To2DF() / 2.0f; TextOfPAK.Position = new asd.Vector2DF(asd.Engine.WindowSize.X / 2.0f, 430); LayerOfStart.AddObject(TextOfTitle); LayerOfStart.AddObject(TextOfPAK); } //ゲームオーバー { LayerOfGameOver = new asd.Layer2D(); TextOfGameOver = new asd.TextObject2D(); TextOfGameOver.Font = asd.Engine.Graphics.CreateDynamicFont("", 100, new asd.Color(0, 0, 0), 0, new asd.Color(255, 255, 255)); TextOfGameOver.Text = "Game Over"; TextOfGameOver.CenterPosition = TextOfGameOver.Font.CalcTextureSize(TextOfGameOver.Text, asd.WritingDirection.Horizontal).To2DF() / 2.0f; TextOfGameOver.Position = new asd.Vector2DF(320.0f, 600.0f); LayerOfGameOver.AddObject(TextOfGameOver); CountOfGameOver = 0; } PairsOfWall = new SortedList <float, float>(); Level = 1; Count = 0; Score = 0; BestScore = bestscore; IsRestart = isrestart; if (!IsRestart) { AddLayer(LayerOfStart); LayerOfStatus.IsDrawn = false; LayerOfMain.IsUpdated = false; LayerOfBackGround_A.IsUpdated = false; } else { LayerOfStart.IsUpdated = false; // 音声ファイルを読み込む。BGMの場合、第2引数を false に設定することで、再生しながらファイルを解凍することが推奨されている。 BGM = asd.Engine.Sound.CreateSoundSource("Sound/PaperPlane_Stage0.ogg", false); // 音声のループを有効にする。 BGM.IsLoopingMode = true; // 音声のループ始端を1秒に、ループ終端を6秒に設定する。 BGM.LoopStartingPoint = 2.0f; BGM.LoopEndPoint = 15.714f; // 音声を再生する。 id_BGM = asd.Engine.Sound.Play(BGM); } //LoadMap("MapData/Map.csv"); MakeMap(100.0f); }