Beyond_Beyaan.BBToolTip.Initialize C# (CSharp) Метод

Initialize() публичный Метод

public Initialize ( string name, string text, int screenWidth, int screenHeight, Random r, string &reason ) : bool
name string
text string
screenWidth int
screenHeight int
r System.Random
reason string
Результат bool
        public bool Initialize(string name, string text, int screenWidth, int screenHeight, Random r, out string reason)
        {
            _text = new BBTextBox();
            if (!_text.Initialize(0, 0, WIDTH - 30, 0, true, false, name, r, out reason))
            {
                return false;
            }
            _text.SetText(text);
            if (_text.Width < WIDTH - 30)
            {
                _actualWidth = _text.Width + 30;
            }
            else
            {
                _actualWidth = WIDTH;
            }

            _totalHeight = _text.Height + 15;

            _background = new BBStretchableImage();
            if (!_background.Initialize(0, 0, _actualWidth, _totalHeight, StretchableImageType.ThinBorderBG, r, out reason))
            {
                return false;
            }

            _showing = false;
            _delayBeforeShowing = 0; //1 second will turn on showing

            _screenWidth = screenWidth;
            _screenHeight = screenHeight;

            reason = null;
            return true;
        }

Usage Example

Пример #1
0
 public bool SetToolTip(string name, string text, int screenWidth, int screenHeight, Random r, out string reason)
 {
     _toolTip = new BBToolTip();
     if (!_toolTip.Initialize(name, text, screenWidth, screenHeight, r, out reason))
     {
         return false;
     }
     return true;
 }