/// <summary> /// ウィンドウオプションを指定して SitrineWindow クラスの新しいインスタンスを初期化します。 /// </summary> /// <param name="options">ウィンドウオプション。</param> public SitrineWindow(WindowOptions options) : base(options.WindowSize.Width, options.WindowSize.Height, GraphicsMode.Default, options.Title) { if (options == null) throw new ArgumentNullException("options"); this.music = new MusicPlayer(new MusicOptions()); this.textures = new TextureList(); this.TargetSize = options.TargetSize; this.textOptions = options.TextOptions; this.stories = new List<Storyboard>(); this.renderStories = new List<RenderStoryboard>(); this.reservedStories = new List<Storyboard>(); this.removingStories = new List<Storyboard>(); this.debugText = new DebugText(options.DebugTextOptions, this); Trace.Listeners.Add(new DebugTextListener(this.debugText)); Trace.WriteLine("Window", "Init"); }
/// <summary> /// ウィンドウオプションを指定して SitrineWindow クラスの新しいインスタンスを初期化します。 /// </summary> /// <param name="options">ウィンドウオプション。</param> public SitrineWindow(WindowOptions options) : base(options.WindowSize.Width, options.WindowSize.Height, GraphicsMode.Default, options.Title) { if (options == null) { throw new ArgumentNullException("options"); } this.music = new MusicPlayer(new MusicOptions()); this.textures = new TextureList(); this.TargetSize = options.TargetSize; this.textOptions = options.TextOptions; this.stories = new List <Storyboard>(); this.renderStories = new List <RenderStoryboard>(); this.reservedStories = new List <Storyboard>(); this.removingStories = new List <Storyboard>(); this.debugText = new DebugText(options.DebugTextOptions, this); Trace.Listeners.Add(new DebugTextListener(this.debugText)); Trace.WriteLine("Window", "Init"); }
static void Main() { using (FontLoader font = new FontLoader("font/VL-Gothic-Regular.ttf")) using (FontLoader debugFont = new FontLoader("font/88 Zen.ttf")) { TextOptions textOptions = new TextOptions(font.Family, 12, 17) { ShadowIndex = 1, DrawShadow = true, Antialiasing = true }; textOptions.SetSolidBrushes(Color.White, Color.Black, Color.OrangeRed); TextOptions debugTextOptions = new TextOptions(debugFont.Family, 8, 8) { ShadowIndex = 1, DrawShadow = true, }; debugTextOptions.SetSolidBrushes(Color.White, Color.Black); WindowOptions options = new WindowOptions() { Title = "Sample", TargetSize = new Size(320, 240), WindowSize = new Size(640, 480), DebugTextOptions = debugTextOptions, TextOptions = textOptions }; using (SitrineWindow window = new SitrineWindow(options)) { window.AddStoryboard(new SampleStory(window)); window.Run(30.0, 60.0); } } }