//[Test] public override void Test(ace.GraphicsType graphicsType) { var option = new ace.EngineOption { GraphicsType = graphicsType, IsFullScreen = false }; var initialized = ace.Engine.Initialize("Empty", 640, 480, option); int time = 0; while (ace.Engine.DoEvents()) { ace.Engine.Update(); if (time == 10) { break; } time++; } ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; var initialized = ace.Engine.Initialize("Joystick", 640, 480, option); ace.JoystickContainer container = ace.Engine.JoystickContainer; //0番目のジョイスティックが接続されているか否かを確かめる if (container.IsPresentAt(0)) { Console.WriteLine(container.GetJoystickAt(0).JoystickName + " was connected."); } else { Console.WriteLine("No joystick are connected."); Console.WriteLine("Hit any key to finish test."); Console.ReadKey(); System.Environment.Exit(1); } Console.WriteLine("Hit any key to continue test."); Console.ReadKey(); //0番目のジョイスティックの0番目のボタンの押下状態を確かめる while (ace.Engine.DoEvents()) { ace.Engine.Update(); switch (container.GetJoystickAt(0).GetButtonState(0)) { case ace.JoystickButtonState.Free: Console.WriteLine("0 Free"); break; case ace.JoystickButtonState.Hold: Console.WriteLine("0 Hold"); break; case ace.JoystickButtonState.Pull: Console.WriteLine("0 Pull"); break; case ace.JoystickButtonState.Push: Console.WriteLine("0 Push"); break; } } ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; ace.Engine.Initialize("Log", 100, 100, option); // Engineに格納されたものを使う(Log.htmlに出力される) var logger = ace.Engine.Logger; logger.Write("文字列"); logger.WriteLine("文字列+改行"); logger.WriteLine("<文字列>"); logger.WriteHeading("ヘッダ"); logger.WriteLineStrongly("強調文字列"); // 水平線(<hr/>) logger.WriteHorizontalRule(); // 表組み logger.BeginTable(); logger.Write("セル1"); logger.ChangeColumn(); logger.Write("セル2(ChangeColumn)"); logger.ChangeRow(); logger.Write("セル3(ChangeRow)"); logger.EndTable(); // SetOutputLevelメソッドで指定したものより低いレベルに指定した出力は、実行されない logger.SetOutputLevel(ace.Log.OutputLevel.Critical); logger.WriteLine("出力されるログ(critical)", ace.Log.OutputLevel.Critical); logger.WriteLine("出力されないログ(information)", ace.Log.OutputLevel.Information); logger.BeginTable(ace.Log.OutputLevel.Warning); logger.Write("出力されないテーブル", ace.Log.OutputLevel.Warning); logger.EndTable(ace.Log.OutputLevel.Warning); Console.WriteLine("Log.html に出力しました"); ace.Engine.Terminate(); }
//[Test] public override void Test(ace.GraphicsType graphicsType) { var option = new ace.EngineOption { GraphicsType = graphicsType, IsFullScreen = false }; bool closed = false; System.Windows.Forms.Form form = new System.Windows.Forms.Form(); form.FormClosed += (object sender, System.Windows.Forms.FormClosedEventArgs e) => { closed = true; }; form.Show(); // aceを初期化する。 ace.Engine.InitializeByExternalWindow(form.Handle, new IntPtr(), form.Size.Width, form.Size.Height, new ace.EngineOption()); int time = 0; // aceが進行可能かチェックする。 while (ace.Engine.DoEvents()) { System.Windows.Forms.Application.DoEvents(); if (closed) { break; } // aceを更新する。 ace.Engine.Update(); if (time == 10) { break; } time++; } // aceを終了する。 ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; var initialized = ace.Engine.Initialize("Mouse2", 640, 480, option); while (ace.Engine.DoEvents()) { ace.Engine.Update(); ace.Mouse mouse = ace.Engine.Mouse; Console.WriteLine("(" + mouse.Position.X + "," + mouse.Position.Y + ")"); } ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; var initialized = ace.Engine.Initialize("Mouse1", 640, 480, option); while (ace.Engine.DoEvents()) { ace.Engine.Update(); ace.Mouse mouse = ace.Engine.Mouse; switch (mouse.MiddleButton.ButtonState) { case ace.MouseButtonState.Free: Console.WriteLine("Middle Free"); break; case ace.MouseButtonState.Hold: Console.WriteLine("Middle Hold"); break; case ace.MouseButtonState.Pull: Console.WriteLine("Middle Pull"); break; case ace.MouseButtonState.Push: Console.WriteLine("Middle Push"); break; } } ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; var initialized = ace.Engine.Initialize("Keyboard", 640, 480, option); while (ace.Engine.DoEvents()) { ace.Engine.Update(); ace.Keyboard keyboard = ace.Engine.Keyboard; switch (keyboard.GetKeyState(ace.Keys.Z)) { case ace.KeyState.Free: Console.WriteLine("Z Free"); break; case ace.KeyState.Hold: Console.WriteLine("Z Hold"); break; case ace.KeyState.Pull: Console.WriteLine("Z Pull"); break; case ace.KeyState.Push: Console.WriteLine("Z Push"); break; } } ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; // aceを初期化する。 ace.Engine.Initialize("Empty", 640, 480, option); // aceが進行可能かチェックする。 while (ace.Engine.DoEvents()) { // aceを更新する。 ace.Engine.Update(); } // aceを終了する。 ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; bool closed = false; System.Windows.Forms.Form form = new System.Windows.Forms.Form(); form.FormClosed += (object sender, System.Windows.Forms.FormClosedEventArgs e) => { closed = true; }; form.Show(); // aceを初期化する。 ace.Engine.InitializeByExternalWindow(form.Handle, IntPtr.Zero, form.Size.Width, form.Size.Height, option); // aceが進行可能かチェックする。 while (ace.Engine.DoEvents()) { System.Windows.Forms.Application.DoEvents(); if (closed) { break; } // aceを更新する。 ace.Engine.Update(); } // aceを終了する。 ace.Engine.Terminate(); }
public void Run() { // 初期設定を行う。 var option = new ace.EngineOption { GraphicsType = ace.GraphicsType.DirectX11, IsFullScreen = false }; // aceを初期化する。 ace.Engine.Initialize("Sound", 640, 480, option); // ファイルを読み込む ace.SoundSource se1 = ace.Engine.Sound.CreateSoundSource("Data/Sound/se1.wav", true); ace.SoundSource bgm1 = ace.Engine.Sound.CreateSoundSource("Data/Sound/bgm1.ogg", false); // 再生する int id_se1 = ace.Engine.Sound.Play(se1); int id_bgm1 = ace.Engine.Sound.Play(bgm1); // aceが進行可能かチェックする。 while (ace.Engine.DoEvents()) { // aceを更新する。 ace.Engine.Update(); // 音が再生終了してるか調べる if (!ace.Engine.Sound.IsPlaying(id_bgm1)) { break; } } // aceを終了する。 ace.Engine.Terminate(); }