/// <summary> /// metodo para acceder al level. /// </summary> /// <param name="level"> objeto level al que se accede. </param> public override void Visit(Level level) { if (level.ScreenList.Count >= 1) { this.LastScreen = level.ScreenList[level.ScreenList.Count - 1]; } try { string name = this.tag.AttributeList["Name"].Value; int positionY = Int32.Parse(this.tag.AttributeList["PositionY"].Value); int positionX = Int32.Parse(this.tag.AttributeList["PositionX"].Value); int length = Int32.Parse(this.tag.AttributeList["Length"].Value); int width = Int32.Parse(this.tag.AttributeList["Width"].Value); string imagePath = this.tag.AttributeList["ImagePath"].Value; string text = this.tag.AttributeList["Text"].Value; IXML button = new ButtonNextPage(name, positionY, positionX, length, width, this.LastScreen, imagePath, text); this.LastScreen.Add(button); } catch (Exception) { string message = "there was an error while fetching data from the XML file"; throw new NotFoundOnXMLException(message); } }
/// <summary> /// metodo que dibuja un ButtonNextPage en Unity. /// </summary> /// <param name="buttonNextPage"> ButtonNextPage a dibujar. </param> public void RenderButtonNextPage(ButtonNextPage buttonNextPage) { buttonNextPage.ButtonId = this.adapter.CreateButton((int)buttonNextPage.PositionX, (int)buttonNextPage.PositionY, (int)buttonNextPage.Width, (int)buttonNextPage.Length, "#FFFFFFFF", buttonNextPage.Action); this.adapter.SetImage(buttonNextPage.ButtonId, buttonNextPage.ImagePath); this.adapter.SetText(buttonNextPage.ButtonId, buttonNextPage.Text); }