public PeventEditor(Pevent pevent, SpriteBundle bundle, PeventClassBundle bundlec) { InitializeComponent(); using (XNAUtils utils = new XNAUtils()) { sBundle = bundle; pEvent = pevent; pSprite = pevent.pSprite; cBundle = bundlec; foreach (PeventClass pClass in cBundle.ListpEventClass) CB_Class.Items.Add(pClass); CB_Class.Text = pevent.Class.ToString(); CB_Direction.SelectedItem = pevent.Direction.ToString(); CHK_Flying.Checked = pevent.Flying; if (pSprite != null) PN_Graphics.BackgroundImage = utils.ConvertToImage(pevent.pSprite.SpriteImage); CB_MoveType.SelectedItem = pevent.MoveType.ToString(); TB_Name.Text = pevent.Name; TB_Script.Text = pevent.Script; LB_Position.Text = pevent.Position.X + " x " + pevent.Position.Y; NUM_Sight.Value = new Decimal(pEvent.Sight); CHK_Through.Checked = pevent.Through; CB_TriggerType.SelectedItem = pevent.TriggerType.ToString(); NUM_Speed.Value = new Decimal(pevent.Velocity); CHK_Disposable.Checked = pevent.Disposable; HasAccepted = false; this.CB_MoveType.SelectedIndexChanged += new System.EventHandler(this.CB_MoveType_SelectedIndexChanged); } }
public Monster(SerializationInfo info, StreamingContext context) { Name = info.GetValue("Name", typeof(String)) as String; mSprite = info.GetValue("mSprite", typeof(Sprite)) as Sprite; Stats = info.GetValue("Stats", typeof(CharactStats)) as CharactStats; Attacks = info.GetValue("Attacks", typeof(List<SpecialAttack>)) as List<SpecialAttack>; Drop = info.GetValue("Drop", typeof(ItemObject)) as ItemObject; DropRate = (Int32)info.GetValue("DropRate", typeof(Int32)); }
public Monster() { Name = "Monstre"; mSprite = new Sprite(); Stats = new CharactStats(); Attacks = new List<SpecialAttack>(); Drop = new ItemObject(); DropRate = 0; }
private void LBSprites_SelectedIndexChanged(object sender, EventArgs e) { using (XNAUtils utils = new XNAUtils()) if (LBSprites.SelectedItem != null) { btnChoisir.Enabled = true; SpriteChoisi = (Sprite)LBSprites.SelectedItem; plPreview.BackgroundImage = utils.ConvertToImage(SpriteChoisi.SpriteImage); } }
public PopUpGraphics(Sprite ppSprite, SpriteBundle psBundle) { sBundle = psBundle; pSprite = ppSprite; InitializeComponent(); using (XNAUtils utils = new XNAUtils()) { if (pSprite != null) PN_Graphics.BackgroundImage = utils.ConvertToImage(pSprite.SpriteImage); } }
private void BTN_Edit_Click(object sender, EventArgs e) { SpritePicker dlg = new SpritePicker(sBundle); dlg.ShowDialog(); pSprite = dlg.SpriteChoisi; if (dlg.Choisi) { using (XNAUtils utils = new XNAUtils()) PN_Graphics.BackgroundImage = utils.ConvertToImage(pSprite.SpriteImage); } }