public override bool InitOne(Microsoft.Xna.Framework.Content.ContentManager content, int id) { XmlDocument _doc = new XmlDocument(); _doc.Load(_xmlInfo); XmlNode _label = _doc.SelectSingleNode("//Label[@id = '" + id.ToString() + "']"); _prototype[id] = new Label(); _prototype[id]._nsprite = 1; _prototype[id]._sprite = new GameSprite[_prototype[id]._nsprite]; Texture2D _tempTexture = content.Load<Texture2D>(_label.SelectSingleNode ("BackGround").InnerText); _prototype[id]._sprite[0] = new GameSprite(_tempTexture, 0, 0); ((Label)_prototype[id]).Sf = content.Load<SpriteFont>(_label.SelectSingleNode("Font").InnerText); ((Label)_prototype[id]).StringInfo = _label.SelectSingleNode("StringInfo").InnerText; _prototype[id].X = int.Parse(_label.SelectSingleNode("X").InnerText); _prototype[id].Y = int.Parse(_label.SelectSingleNode("Y").InnerText); _prototype[id].OffSetX = _prototype[id].X; _prototype[id].OffSetY = _prototype[id].Y; ((Label)_prototype[id]).DrawOffSetX = int.Parse(_label.SelectSingleNode("DrawOffSetX").InnerText); ((Label)_prototype[id]).DrawOffSetY = int.Parse(_label.SelectSingleNode("DrawOffSetY").InnerText); float _red = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("R").InnerText); float _green = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("G").InnerText); float _blue = float.Parse(_label.SelectSingleNode("Color").SelectSingleNode("B").InnerText); ((Label)_prototype[id]).StringColor = new Color(_red, _green, _blue); return true; }
public void GetSkillLevel(Label _label) { _label.StringInfo = ((Skill)_label.Owner).Level.ToString(); if (((Skill)_label.Owner).Level == ((Skill)_label.Owner).ListLevel.Count - 1) { _label.StringColor = Color.Red; } }
//--------------------------------------------------------------------------------------------------- public void GetResources(List<GameObjectManager> _resources) { //Khoi tao cac bien Addition _lhAddition = 50; _rhAddition = 50; _passiveAddition = 50; _preLevelOfChar = _character.Level; _boardFrame = (GameFrame)_resources[0].CreateObject(1); _boardFrame.IsVisible = false; //Press Button sử dụng chung trên 3 tab. _btLeftSkillControl = (Button)_resources[1].CreateObject(2); _btLeftSkillControl._sprite[0].Itexture2D = 1; //Được click trước tiên _btLeftSkillControl.Mouse_Down += new Button.OnMouseDownHandler(SkillBoard_MouseDown_LeftButtonControl); _btLeftSkillControl.IsPressButton = true; _btRightSkillControl = (Button)_resources[1].CreateObject(3); _btRightSkillControl.Mouse_Down += new Button.OnMouseDownHandler(SkillBoard_MouseDown_RightButtonControl); _btRightSkillControl.IsPressButton = true; _btPassiveSkillControl = (Button)_resources[1].CreateObject(4); _btPassiveSkillControl.Mouse_Down += new Button.OnMouseDownHandler(SkillBoard_MouseDown_PassiveButtonControl); _btPassiveSkillControl.IsPressButton = true; //LeftHand tab #region _btLefthandExit = (Button)_resources[1].CreateObject(11); _btLefthandExit.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_LeftExit); //Cleaving _btSkillCleaving = (Button)_resources[1].CreateObject(5); _btSkillCleaving.Owner = _character.ListLeftHandSkill[1]; _btSkillCleaving.GetNewIdleTexture(_character.ListLeftHandSkill[1].IdleIcon); _btSkillCleaving.GetNewClickedTexture(_character.ListLeftHandSkill[1].ClickedIcon); _btSkillCleaving.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_CleavingAttack); _btSkillCleaving.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_CleavingAttack); _btSkillCleaving.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_CleavingAttack); _lbSkillCleaving = (Label)_resources[2].CreateObject(0); _lbSkillCleaving.Owner = _character.ListLeftHandSkill[1]; //Critical _btSkillCritical = (Button)_resources[1].CreateObject(6); _btSkillCritical.Owner = _character.ListLeftHandSkill[2]; _btSkillCritical.GetNewIdleTexture(_character.ListLeftHandSkill[2].IdleIcon); _btSkillCritical.GetNewClickedTexture(_character.ListLeftHandSkill[2].ClickedIcon); _btSkillCritical.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_CriticalAttack); _btSkillCritical.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_CriticalAttack); _btSkillCritical.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_CriticalAttack); _lbSkillCritical = (Label)_resources[2].CreateObject(1); _lbSkillCritical.Owner = _character.ListLeftHandSkill[2]; //Curse _btSkillCurse = (Button)_resources[1].CreateObject(7); _btSkillCurse.Owner = _character.ListLeftHandSkill[3]; _btSkillCurse.GetNewIdleTexture(_character.ListLeftHandSkill[3].IdleIcon); _btSkillCurse.GetNewClickedTexture(_character.ListLeftHandSkill[3].ClickedIcon); _btSkillCurse.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_CurseAttack); _btSkillCurse.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_CurseAttack); _btSkillCurse.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_CurseAttack); _lbSkillCurse = (Label)_resources[2].CreateObject(2); _lbSkillCurse.Owner = _character.ListLeftHandSkill[3]; //Overspeed _btSkillOverSpeed = (Button)_resources[1].CreateObject(8); _btSkillOverSpeed.Owner = _character.ListLeftHandSkill[4]; _btSkillOverSpeed.GetNewIdleTexture(_character.ListLeftHandSkill[4].IdleIcon); _btSkillOverSpeed.GetNewClickedTexture(_character.ListLeftHandSkill[4].ClickedIcon); _btSkillOverSpeed.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_OverSpeedAttack); _btSkillOverSpeed.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_OverSpeedAttack); _btSkillOverSpeed.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_OverSpeedAttack); _lbSkillOverspeed = (Label)_resources[2].CreateObject(3); _lbSkillOverspeed.Owner = _character.ListLeftHandSkill[4]; //Lifesteal _btSkillLifeSteal = (Button)_resources[1].CreateObject(9); _btSkillLifeSteal.Owner = _character.ListLeftHandSkill[5]; _btSkillLifeSteal.GetNewIdleTexture(_character.ListLeftHandSkill[5].IdleIcon); _btSkillLifeSteal.GetNewClickedTexture(_character.ListLeftHandSkill[5].ClickedIcon); _btSkillLifeSteal.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_LifeStealAttack); _btSkillLifeSteal.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_LifeStealAttack); _btSkillLifeSteal.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_LifeStealAttack); _lbSkillLifeSteal = (Label)_resources[2].CreateObject(4); _lbSkillLifeSteal.Owner = _character.ListLeftHandSkill[5]; //Bash _btSkillBash = (Button)_resources[1].CreateObject(10); _btSkillBash.Owner = _character.ListLeftHandSkill[6]; _btSkillBash.GetNewIdleTexture(_character.ListLeftHandSkill[6].IdleIcon); _btSkillBash.GetNewClickedTexture(_character.ListLeftHandSkill[6].ClickedIcon); _btSkillBash.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_BashAttack); _btSkillBash.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_BashAttack); _btSkillBash.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_BashAttack); _lbSkillBash = (Label)_resources[2].CreateObject(5); _lbSkillBash.Owner = _character.ListLeftHandSkill[6]; //Label diem cong _lbLHAddition = (Label)_resources[2].CreateObject(15); _lbLHAddition.StringInfo = _lhAddition.ToString(); _lefthandFrame = (GameFrame)_resources[0].CreateObject(2); //4 vị trí đầu là các control trên tab _lefthandFrame.AddChild(_btLeftSkillControl); _lefthandFrame.AddChild(_btRightSkillControl); _lefthandFrame.AddChild(_btPassiveSkillControl); _lefthandFrame.AddChild(_btLefthandExit); //Các vị trí còn lại là các button Skill _lefthandFrame.AddChild(_btSkillCleaving); _lefthandFrame.AddChild(_lbSkillCleaving); _lefthandFrame.AddChild(_btSkillCritical); _lefthandFrame.AddChild(_lbSkillCritical); _lefthandFrame.AddChild(_btSkillCurse); _lefthandFrame.AddChild(_lbSkillCurse); _lefthandFrame.AddChild(_btSkillOverSpeed); _lefthandFrame.AddChild(_lbSkillOverspeed); _lefthandFrame.AddChild(_btSkillLifeSteal); _lefthandFrame.AddChild(_lbSkillLifeSteal); _lefthandFrame.AddChild(_btSkillBash); _lefthandFrame.AddChild(_lbSkillBash); _lefthandFrame.AddChild(_lbLHAddition); //Add vào tab control (Frame mẹ) _boardFrame.AddChild(_lefthandFrame); #endregion //RightHand tab #region _btRighthandExit = (Button)_resources[1].CreateObject(12); _btRighthandExit.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_RightExit); //Deadly bees _btDeadlyBeesSkill = (Button)_resources[1].CreateObject(23); _btDeadlyBeesSkill.Owner = (Skill)_character.ListRightHandSkill[1]; _btDeadlyBeesSkill.GetNewIdleTexture(_character.ListRightHandSkill[1].IdleIcon); _btDeadlyBeesSkill.GetNewClickedTexture(_character.ListRightHandSkill[1].ClickedIcon); _btDeadlyBeesSkill.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_DeadlyBees); _btDeadlyBeesSkill.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_DeadlyBees); _btDeadlyBeesSkill.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_DeadlyBees); _lbDeadlyBeesSkill = (Label)_resources[2].CreateObject(6); _lbDeadlyBeesSkill.Owner = _character.ListRightHandSkill[1]; //SoulRelease _btSoulRelease = (Button)_resources[1].CreateObject(24); _btSoulRelease.Owner = _character.ListRightHandSkill[2]; _btSoulRelease.GetNewIdleTexture(_character.ListRightHandSkill[2].IdleIcon); _btSoulRelease.GetNewClickedTexture(_character.ListRightHandSkill[2].ClickedIcon); _btSoulRelease.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_SoulRelease); _btSoulRelease.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_SoulRelease); _btSoulRelease.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_SoulRelease); _lbSoulRelease = (Label)_resources[2].CreateObject(7); _lbSoulRelease.Owner = _character.ListRightHandSkill[2]; //Earth shake _btEathShakeSkill = (Button)_resources[1].CreateObject(25); _btEathShakeSkill.Owner = _character.ListRightHandSkill[3]; _btEathShakeSkill.GetNewIdleTexture(_character.ListRightHandSkill[3].IdleIcon); _btEathShakeSkill.GetNewClickedTexture(_character.ListRightHandSkill[3].ClickedIcon); _btEathShakeSkill.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_EarthShake); _btEathShakeSkill.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_EarthShake); _btEathShakeSkill.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_EarthShake); _lbEathShakeSkill = (Label)_resources[2].CreateObject(8); _lbEathShakeSkill.Owner = _character.ListRightHandSkill[3]; //Wave form _btWaveFormSkill = (Button)_resources[1].CreateObject(26); _btWaveFormSkill.Owner = _character.ListRightHandSkill[4]; _btWaveFormSkill.GetNewIdleTexture(_character.ListRightHandSkill[4].IdleIcon); _btWaveFormSkill.GetNewClickedTexture(_character.ListRightHandSkill[4].ClickedIcon); _btWaveFormSkill.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_WaveForm); _btWaveFormSkill.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_WaveForm); _btWaveFormSkill.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_WaveForm); _lbWaveFormSkill = (Label)_resources[2].CreateObject(9); _lbWaveFormSkill.Owner = _character.ListRightHandSkill[4]; //Lighting Field _btLightingField = (Button)_resources[1].CreateObject(27); _btLightingField.Owner = _character.ListRightHandSkill[5]; _btLightingField.GetNewIdleTexture(_character.ListRightHandSkill[5].IdleIcon); _btLightingField.GetNewClickedTexture(_character.ListRightHandSkill[5].ClickedIcon); _btLightingField.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_LightingField); _btLightingField.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_LightingField); _btLightingField.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_LightingField); _lbLightingField = (Label)_resources[2].CreateObject(10); _lbLightingField.Owner = _character.ListRightHandSkill[5]; //Invisible _btInvisible = (Button)_resources[1].CreateObject(28); _btInvisible.Owner = _character.ListRightHandSkill[6]; _btInvisible.GetNewIdleTexture(_character.ListRightHandSkill[6].IdleIcon); _btInvisible.GetNewClickedTexture(_character.ListRightHandSkill[6].ClickedIcon); _btInvisible.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_Invisible); _btInvisible.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_Invisible); _btInvisible.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_Invisible); _lbInvisible = (Label)_resources[2].CreateObject(11); _lbInvisible.Owner = _character.ListRightHandSkill[6]; //Label diem cong _lbRHAddition = (Label)_resources[2].CreateObject(15); _lbRHAddition.StringInfo = _rhAddition.ToString(); //RightthandFrame-hand frame _rightthandFrame = (GameFrame)_resources[0].CreateObject(3); _rightthandFrame.AddChild(_btLeftSkillControl); _rightthandFrame.AddChild(_btRightSkillControl); _rightthandFrame.AddChild(_btPassiveSkillControl); _rightthandFrame.AddChild(_btRighthandExit); _rightthandFrame.AddChild(_btDeadlyBeesSkill); _rightthandFrame.AddChild(_lbDeadlyBeesSkill); _rightthandFrame.AddChild(_btSoulRelease); _rightthandFrame.AddChild(_lbSoulRelease); _rightthandFrame.AddChild(_btEathShakeSkill); _rightthandFrame.AddChild(_lbEathShakeSkill); _rightthandFrame.AddChild(_btWaveFormSkill); _rightthandFrame.AddChild(_lbWaveFormSkill); _rightthandFrame.AddChild(_btLightingField); _rightthandFrame.AddChild(_lbLightingField); _rightthandFrame.AddChild(_btInvisible); _rightthandFrame.AddChild(_lbInvisible); _rightthandFrame.AddChild(_lbRHAddition); _boardFrame.AddChild(_rightthandFrame); #endregion //Passive tab #region _btPassiveExit = (Button)_resources[1].CreateObject(13); _btPassiveExit.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_PassiveExit); //Great Fortitude _btGreatFortitude = (Button)_resources[1].CreateObject(37); _btGreatFortitude.Owner = _character.ListPassiveSkill[0]; _btGreatFortitude.GetNewIdleTexture(_character.ListPassiveSkill[0].IdleIcon); _btGreatFortitude.GetNewClickedTexture(_character.ListPassiveSkill[0].ClickedIcon); _btGreatFortitude.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_GreatFortitude); _btGreatFortitude.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_GreatFortitude); _btGreatFortitude.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_GreatFortitude); _lbbtGreatFortitude = (Label)_resources[2].CreateObject(12); _lbbtGreatFortitude.Owner = _character.ListPassiveSkill[0]; //God Strenght _btGodStrength = (Button)_resources[1].CreateObject(38); _btGodStrength.Owner = _character.ListPassiveSkill[1]; _btGodStrength.GetNewIdleTexture(_character.ListPassiveSkill[1].IdleIcon); _btGodStrength.GetNewClickedTexture(_character.ListPassiveSkill[1].ClickedIcon); _btGodStrength.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_GodStrenght); _btGodStrength.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_GodStrenght); _btGodStrength.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_GodStrenght); _lbGodStrength = (Label)_resources[2].CreateObject(13); _lbGodStrength.Owner = _character.ListPassiveSkill[1]; //BLur _btBlur = (Button)_resources[1].CreateObject(39); _btBlur.Owner = _character.ListPassiveSkill[2]; _btBlur.GetNewIdleTexture(_character.ListPassiveSkill[2].IdleIcon); _btBlur.GetNewClickedTexture(_character.ListPassiveSkill[2].ClickedIcon); _btBlur.Mouse_Click += new Button.OnMouseClickHandler(SkillBoard_MouseClick_Blur); _btBlur.Mouse_Hover += new Button.OnMouseHoverHandler(SkillBoard_MouseHover_Blur); _btBlur.Mouse_Released += new Button.OnMouseReleasedHandler(SkillBoard_MouseRelease_Blur); _lbBlur = (Label)_resources[2].CreateObject(14); _lbBlur.Owner = _character.ListPassiveSkill[2]; //label diem cong _lbPassiveAddtion = (Label)_resources[2].CreateObject(15); _lbPassiveAddtion.StringInfo = _passiveAddition.ToString(); //Passive frame _passiveFrame = (GameFrame)_resources[0].CreateObject(4); _passiveFrame.AddChild(_btLeftSkillControl); _passiveFrame.AddChild(_btRightSkillControl); _passiveFrame.AddChild(_btPassiveSkillControl); _passiveFrame.AddChild(_btPassiveExit); _passiveFrame.AddChild(_btGreatFortitude); _passiveFrame.AddChild(_lbbtGreatFortitude); _passiveFrame.AddChild(_btGodStrength); _passiveFrame.AddChild(_lbGodStrength); _passiveFrame.AddChild(_btBlur); _passiveFrame.AddChild(_lbBlur); _passiveFrame.AddChild(_lbPassiveAddtion); _boardFrame.AddChild(_passiveFrame); #endregion _iCurrentBoard = 0; _currentBoard = (GameFrame)_boardFrame.Child[_iCurrentBoard]; _rect = new Rectangle((int)_boardFrame.X, (int)_boardFrame.Y, (int)_boardFrame.Width, (int)_boardFrame.Height); //Khởi tạo 1 số giá trị mặt định về skill của nhân vật //Left hand //_btSkillCurse.Endalbe = false; //_btSkillOverSpeed.Endalbe = false; //_btSkillLifeSteal.Endalbe = false; //_btSkillBash.Endalbe = false; //Right //_btEathShakeSkill.Endalbe = false; //_btWaveFormSkill.Endalbe = false; //_btLightingField.Endalbe = false; //_btInvisible.Endalbe = false; //Passive //_btGodStrength.Endalbe = false; //_btBlur.Endalbe = false; }
public void GetResources(List<GameObjectManager> _resouces) { HealbarFrame = (GameFrame)_resouces[0].CreateObject(0); BloodPro = (ProcessBar)_resouces[1].CreateObject(0); ManaPro = (ProcessBar)_resouces[1].CreateObject(1); //Button left _btLeftCommand = (Button)_resouces[2].CreateObject(0); _btLeftCommand.Mouse_Click += new Button.OnMouseClickHandler(LeftCommandButon_Clicked); HealbarFrame.AddChild(_btLeftCommand); _btRightCommand = (Button)_resouces[2].CreateObject(1); _btRightCommand.Mouse_Click += new Button.OnMouseClickHandler(RightCommandButon_Clicked); HealbarFrame.AddChild(_btRightCommand); _btLefthandSkill = (Button)_resouces[2].CreateObject(14); _btLefthandSkill.Owner = _character.ListLeftHandSkill[0]; _btLefthandSkill.GetNewIdleTexture(_character.ListLeftHandSkill[0].IdleIcon); _btLefthandSkill.GetNewClickedTexture(_character.ListLeftHandSkill[0].ClickedIcon); _btLefthandSkill.Mouse_Click += new Button.OnMouseClickHandler(LeftSkillButon_Clicked); _btLefthandSkill.Mouse_Hover += new Button.OnMouseHoverHandler(LeftSkillButon_Hover); _btLefthandSkill.Mouse_Released += new Button.OnMouseReleasedHandler(LeftSkillButon_Release); HealbarFrame.AddChild(_btLefthandSkill); //Button right _btRighthandSkill = (Button)_resouces[2].CreateObject(22); _btRighthandSkill.Owner = _character.ListRightHandSkill[0]; _btRighthandSkill.GetNewIdleTexture(_character.ListRightHandSkill[0].IdleIcon); _btRighthandSkill.GetNewClickedTexture(_character.ListRightHandSkill[0].ClickedIcon); _btRighthandSkill.Mouse_Click += new Button.OnMouseClickHandler(RightSkillButon_Clicked); _btRighthandSkill.Mouse_Hover += new Button.OnMouseHoverHandler(RightSkillButon_Hover); _btRighthandSkill.Mouse_Released += new Button.OnMouseReleasedHandler(RightSkillButon_Release); HealbarFrame.AddChild(_btRighthandSkill); _coolDownRightSkill = (ProcessBar)_resouces[1].CreateObject(2); _healbarFrame.AddChild(_coolDownRightSkill); _coolDownLeftSkill = (ProcessBar)_resouces[1].CreateObject(3); _healbarFrame.AddChild(_coolDownLeftSkill); _levelProcess = (ProcessBar)_resouces[1].CreateObject(4); _healbarFrame.AddChild(_levelProcess); _btCMUpButton = (Button)_resouces[2].CreateObject(35); _btCMUpButton.Mouse_Click += new Button.OnMouseClickHandler(UpCommandbutton_Clicked); _healbarFrame.AddChild (_btCMUpButton); //item blood, mana, both _itemFrame = (GameFrame)_resouces[0].CreateObject(10); _itemFrame.X += _healbarFrame.X; _itemFrame.Y += _healbarFrame.Y; _btBlood = (Button)_resouces[2].CreateObject(47); _btBlood.Mouse_Click += new Button.OnMouseClickHandler(BloodButton_Clicked); _lbBlood = (Label)_resouces[3].CreateObject(16); _lbBlood.StringInfo = _character.HPPortion.Count.ToString(); _itemFrame.AddChild(_btBlood); _itemFrame.AddChild(_lbBlood); //mana _btMana = (Button)_resouces[2].CreateObject(48); _btMana.Mouse_Click += new Button.OnMouseClickHandler(ManaButton_Clicked); _lbMana = (Label)_resouces[3].CreateObject(17); _lbMana.StringInfo = _character.MPPortion.Count.ToString(); _itemFrame.AddChild(_btMana); _itemFrame.AddChild(_lbMana); //both _btBloodNMana = (Button)_resouces[2].CreateObject(49); _btBloodNMana.Mouse_Click += new Button.OnMouseClickHandler(BloodNManaButton_Clicked); _lbBloodNMana = (Label)_resouces[3].CreateObject(18); _lbBloodNMana.StringInfo = _character.RestorePortion.Count.ToString(); _itemFrame.AddChild(_btBloodNMana); _itemFrame.AddChild(_lbBloodNMana); _rect = new Rectangle((int)_healbarFrame.X, (int)_healbarFrame.Y, (int)_healbarFrame.Width, (int)_healbarFrame.Height); }
public override VisibleGameObject Clone() { Label _new = new Label(); _new._nsprite = _nsprite; _new._sprite = new GameSprite [_new._nsprite]; for (int i = 0; i < _new._nsprite; i++) { _new._sprite[i] = _sprite[i]; } _new._sf = _sf; _new._stringInfo = _stringInfo; _new._stringColor = _stringColor; _new._x = _x; _new._y = _y; _new.OffSetX = OffSetX; _new.OffSetY = OffSetY; _new._drawX = _drawX; _new._drawY = _drawY; _new._drawOffSetX = _drawOffSetX; _new._drawOffSetY = _drawOffSetY; return _new; }