Exemplo n.º 1
0
 public void UpdateOverEntities(MouseOverList list, Point mousePosition)
 {
     m_overObject = list.GetForemostMouseOverItem(mousePosition);
     m_overGround = list.GetForemostMouseOverItem<Ground>(mousePosition);
 }
Exemplo n.º 2
0
        private bool Draw3DStretched(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOverList, Map map)
        {
            // this is an isometric stretched tile and needs a specialized draw routine.
            m_vertexBufferAlternate[0].Position = drawPosition + m_vertex0_yOffset;
            m_vertexBufferAlternate[1].Position = drawPosition + m_vertex1_yOffset;
            m_vertexBufferAlternate[2].Position = drawPosition + m_vertex2_yOffset;
            m_vertexBufferAlternate[3].Position = drawPosition + m_vertex3_yOffset;

            if (!spriteBatch.DrawSprite(DrawTexture, m_vertexBufferAlternate, s_Technique))
                return false;

            if ((mouseOverList.PickType & PickType) == PickType)
            {
                if (mouseOverList.IsMouseInObjectIsometric(m_vertexBufferAlternate))
                {
                    MouseOverItem item = new MouseOverItem(DrawTexture, m_vertexBufferAlternate[0].Position, Entity);
                    item.Vertices = new Vector3[4] { m_vertexBufferAlternate[0].Position, m_vertexBufferAlternate[1].Position, m_vertexBufferAlternate[2].Position, m_vertexBufferAlternate[3].Position };
                    mouseOverList.Add2DItem(item);
                }
            }

            return true;
        }
Exemplo n.º 3
0
 public void Add2DItem(MouseOverItem item)
 {
     m_overList.Add(item);
 }
Exemplo n.º 4
0
 protected void Pick(MouseOverList mouseOverList, VertexPositionNormalTextureHue[] vertexBuffer)
 {
     if ((mouseOverList.PickType & PickType) == PickType)
     {
         if (((!DrawFlip) && mouseOverList.IsMouseInObject(vertexBuffer[0].Position, vertexBuffer[3].Position)) ||
             ((DrawFlip) && mouseOverList.IsMouseInObject(vertexBuffer[2].Position, vertexBuffer[1].Position)))
         {
             MouseOverItem item;
             if (!DrawFlip)
             {
                 item = new MouseOverItem(DrawTexture, vertexBuffer[0].Position, Entity);
                 item.Vertices = new Vector3[4] { vertexBuffer[0].Position, vertexBuffer[1].Position, vertexBuffer[2].Position, vertexBuffer[3].Position };
             }
             else
             {
                 item = new MouseOverItem(DrawTexture, vertexBuffer[2].Position, Entity);
                 item.Vertices = new Vector3[4] { vertexBuffer[2].Position, vertexBuffer[0].Position, vertexBuffer[3].Position, vertexBuffer[1].Position };
                 item.FlippedTexture = true;
             }
             mouseOverList.Add2DItem(item);
         }
     }
 }
Exemplo n.º 5
0
 public void UpdateOverEntities(MouseOverList list, Point mousePosition)
 {
     m_overObject = list.GetForemostMouseOverItem(mousePosition);
     m_overGround = list.GetForemostMouseOverItem <Ground>(mousePosition);
 }