protected override void Pick(MouseOverList mouseOver, VertexPositionNormalTextureHue[] vertexBuffer) { int x = mouseOver.MousePosition.X - (int)vertexBuffer[0].Position.X; int y = mouseOver.MousePosition.Y - (int)vertexBuffer[0].Position.Y; if (Provider.IsPointInItemTexture(m_DisplayItemID, x, y, 1)) { mouseOver.AddItem(Entity, vertexBuffer[0].Position); } }
bool Draw3DStretched(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOver, 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, Technique)) { return(false); } if ((mouseOver.PickType & PickType) == PickType) { if (mouseOver.IsMouseInObjectIsometric(m_vertexBufferAlternate)) { mouseOver.AddItem(Entity, m_vertexBufferAlternate[0].Position); } } return(true); }
void MobilePick(MouseOverList mouseOver, Vector3 drawPosition, Rectangle area, AAnimationFrame frame) { int x, y; if (DrawFlip) { // when flipped, the upper right pixel = drawPosition.x + DrawArea.x + 44 // the upper left pixel = drawposition.x + drawarea.x + 44 - drawarea.width. // don't forget to reverse the mouse position! x = (int)drawPosition.X + area.X + IsometricRenderer.TILE_SIZE_INTEGER - mouseOver.MousePosition.X; } else { // ul pixel = (drawposition - drawarea.x) x = mouseOver.MousePosition.X - (int)drawPosition.X + area.X; } y = mouseOver.MousePosition.Y - ((int)drawPosition.Y - area.Y); if (frame.IsPointInTexture(x, y)) { mouseOver.AddItem(Entity, drawPosition); } }
bool Draw3DStretched(SpriteBatch3D spriteBatch, Vector3 drawPosition, MouseOverList mouseOver, 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, Technique)) { return false; } if ((mouseOver.PickType & PickType) == PickType) { if (mouseOver.IsMouseInObjectIsometric(m_vertexBufferAlternate)) { mouseOver.AddItem(Entity, m_vertexBufferAlternate[0].Position); } } return true; }