Beispiel #1
0
    public void Close()
    {
        if (currentOpenPanel == this)
            currentOpenPanel = null;

        Destroy(gameObject);
    }
Beispiel #2
0
 public void ShowInfo()
 {
     if (statInfo == null) {
         statInfo = ToolTipPanel.Show(CrewInspector.Instance.transform, rectTransform, new Vector3(rectTransform.rect.width, 0f, 0f));
         statInfo.SetText(ToolTipStrings.StatInfo(statType), GetToolTipInfoLabel());
     }
 }
Beispiel #3
0
 public void SetToolTip(ToolTipPanel tooltip)
 {
     _name.text        = tooltip._name.text;
     _description.text = tooltip._description.text;
     _comboString.text = tooltip._comboString.text;
     _stats.text       = tooltip._stats.text;
     _cost.text        = tooltip._cost.text;
     skill             = tooltip.skill;
 }
Beispiel #4
0
    public static ToolTipPanel Show(Transform parentTransform, RectTransform positionRelativeTo, Vector3 position)
    {
        GameObject toolTip = (GameObject) Instantiate(Resources.Load("GUI/StatsPanel/ToolTipPanel"));
        ToolTipPanel panel = toolTip.GetComponent<ToolTipPanel>();

        toolTip.transform.SetParent(positionRelativeTo);
        toolTip.transform.localPosition = position;
        toolTip.transform.SetParent(parentTransform);
        toolTip.transform.SetAsLastSibling();
        toolTip.transform.localScale = Vector3.one;

        if (currentOpenPanel != null)
            currentOpenPanel.Close();

        currentOpenPanel = panel;
        return panel;
    }
 private void InitializeComponent()
 {
     this.picPictureBox             = new PictureBox();
     this.pnlToolTip                = new ToolTipPanel();
     this.picPictureBox.Location    = new Point(126, 17);
     this.picPictureBox.Name        = "picPictureBox";
     this.picPictureBox.TabIndex    = 0;
     this.picPictureBox.TabStop     = false;
     this.picPictureBox.MouseUp    += new MouseEventHandler(this.picPictureBox_MouseUp);
     this.picPictureBox.MouseMove  += new MouseEventHandler(this.picPictureBox_MouseMove);
     this.picPictureBox.MouseLeave += new EventHandler(this.picPictureBox_MouseLeave);
     this.picPictureBox.MouseDown  += new MouseEventHandler(this.picPictureBox_MouseDown);
     this.pnlToolTip.BackColor      = SystemColors.Window;
     this.pnlToolTip.BorderStyle    = BorderStyle.FixedSingle;
     this.pnlToolTip.Name           = "pnlToolTip";
     this.pnlToolTip.TabIndex       = 0;
 }
Beispiel #6
0
 public void InitHoverOverText(ToolTipPanel target, string text)
 {
     this.target   = target;
     TextToDisplay = text;
 }