Ejemplo n.º 1
0
 internal void SelectItem(itemPanel ip)
 {
     selectedItemPanel     = ip;
     verticalModifier      = selectedItemPanel.End();
     itemPanelScrollMatrix = Matrix.CreateTranslation(0, -verticalModifier, 0);
     openDifferentDescription();
 }
Ejemplo n.º 2
0
        public void Clicked()
        {
            Rectangle titleActualBox = new Rectangle(Location().X, Location().Y, TitleTextBox.Width, TitleTextBox.Height);
            Vector2   beep           = Mouse.GetState().Position.ToVector2() / ResolutionUtility.stdScale;

            if (titleActualBox.Contains(beep) && !bBeingDragged)
            {
                clickMoveOffSet = Location().Location.ToVector2() - beep;
                bBeingDragged   = true;
            }
            else
            {
                foreach (var item in lip)
                {
                    if (item.frameLoc((int)(verticalModifier), Location().Location + itemCollectionRenderLocation.Location).Contains(beep))
                    {
                        selectedItemPanel     = item;
                        verticalModifier      = selectedItemPanel.End();
                        itemPanelScrollMatrix = Matrix.CreateTranslation(0, -verticalModifier, 0);
                        openDifferentDescription();
                        KeyboardMouseUtility.bPressed = true;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
    public void onMouseDown()
    {
        draging = true;
        panel.transform.position = transform.position;
        panel.SetActive(true);
        itemPanel itemPanel = panel.GetComponent <itemPanel>();

        itemPanel.ItemName        = itemInf.itemName;
        itemPanel.ItemPrice       = itemInf.Price;
        itemPanel.ItemExplanation = itemInf.Explanation;
        itemPanel.ItemCommentary  = itemInf.Commentary;
    }
Ejemplo n.º 4
0
 public void init(int itemNo, item_representation inf, GameObject panel)
 {
     no          = itemNo;
     Icon.sprite = ImageList.main.itemIcon[no];
     if (itemName != null)
     {
         itemName.text = inf.itemName;
     }
     if (itemCost != null)
     {
         itemCost.text = "" + inf.Price;
     }
     itemInf    = inf;
     this.panel = panel.GetComponent <itemPanel>();
 }