Example #1
0
 public EOChatBubble(EOCharacterRenderer following)
     : base(EOGame.Instance)
 {
     m_ref = following;
     isChar = true;
     DrawOrder = following.Character.ID + (int)ControlDrawLayer.BaseLayer + 1; //use ID for draw order
     _initLabel();
     Visible = false;
     EOGame.Instance.Components.Add(this);
 }
Example #2
0
		private void doShowCharacters()
		{
			//remove any existing character renderers
			List<EOCharacterRenderer> toRemove = Components.OfType<EOCharacterRenderer>().ToList();
			foreach (EOCharacterRenderer eor in toRemove)
				eor.Close();

			//show the new data
			EOCharacterRenderer[] render = new EOCharacterRenderer[World.Instance.MainPlayer.CharData.Length];
			for (int i = 0; i < World.Instance.MainPlayer.CharData.Length; ++i)
			{
				//need to get actual draw location
				//int dOrder = 0; //for debugging
				//if (render[i] != null)
				//	dOrder = render[i].DrawOrder;
				render[i] = new EOCharacterRenderer(new Vector2(395, 60 + i * 124), World.Instance.MainPlayer.CharData[i]);
			}
		}
Example #3
0
        public void ResetGameElements()
        {
            if (m_mapRender != null)
            {
                m_mapRender.Dispose();
                m_mapRender = null;
            }

            if (m_charRender != null)
            {
                m_charRender.Dispose();
                m_charRender = null;
            }

            if(MapCache != null) MapCache.Clear();
        }
        public void SetCharacterRenderer(EOCharacterRenderer rend)
        {
            m_rend = rend;
            //update draw location
            Rectangle rendRect = rend.DrawAreaWithOffset;

            DrawLocation = new Vector2(rendRect.Right + 20, rendRect.Y + rend.TopPixel);

            if (DrawAreaWithOffset.Right > Game.GraphicsDevice.PresentationParameters.BackBufferWidth - 15)
            {
                //case: goes off the right side of the screen, show on the left
                DrawLocation = new Vector2(rendRect.X - DrawArea.Width - 20, drawLocation.Y);
            }
            //MAGIC NUMBER: 308px is the bottom of the display area for map stuff
            if (DrawAreaWithOffset.Bottom > 308)
            {
                //case: goes off bottom of the screen, adjust new rectangle so it is above 308
                DrawLocation = new Vector2(drawLocation.X, 298 - DrawArea.Height);
            }
            else if (DrawAreaWithOffset.Y < 25)
            {
                //case: goes off top of screen, adjust new rectangle so it aligns with top of character head
                DrawLocation = new Vector2(drawLocation.X, 35);
            }

            EOGame.Instance.Hud.SetStatusLabel(DATCONST2.STATUS_LABEL_TYPE_ACTION, DATCONST2.STATUS_LABEL_MENU_BELONGS_TO_PLAYER, m_rend.Character.Name);

            Visible = true;
        }