public Pose(ImagePair image, int dx, int dy, int duration) { ImagePair = image; Dx = dx; Dy = dy; Duration = duration; }
/// <summary> /// アプリケーション起動時処理 /// トレイアイコンとかの生成 /// </summary> /// <param name="e"></param> protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); LoadConfiguration(); this.ShutdownMode = ShutdownMode.OnExplicitShutdown; this.notifyIcon = new NotifyIconWrapper(); List <Pose> poses = new List <Pose>(); for (int i = 0; i < 6; i++) { ImagePair imagePair = ImagePairLoader.Load(@"C:\Sync\gif\irisu\3px\rabiribi_iris_page" + (i + 1) + ".png"); Pose pose = new Pose(imagePair, 6); poses.Add(pose); } Animation animation = new Animation(poses.ToArray()); Mascot mascot = new Mascot(animation); MascotView view = new MascotView(mascot); view.Show(); var token = CancellationToken.None; while (true) { await Task.WhenAll(Task.Delay(1), Task.Run(() => { mascot.Tick(); }, token)); } //CreateFirst(); }
public void Next(Mascot mascot) { mascot.ImageData = ImagePair.GetImage(mascot.IsLookRight); }
public Pose(ImagePair image, int duration) : this(image, 0, 0, duration) { }
public Pose(ImagePair image) : this(image, 0, 0, 1) { }