예제 #1
0
 public void Show(string title, NameTextBoxType type, string text, JyGame.GameData.CommonSettings.VoidCallBack callback, int maxLength = 8)
 {
     this.callback       = callback;
     this.title.Text     = title;
     this.Type           = type;
     this.text.Text      = text;
     this.Visibility     = System.Windows.Visibility.Visible;
     this.text.MaxLength = maxLength;
 }
예제 #2
0
        public SelfManagedAnimation(
            Canvas parentCanvas,
            int repeatTime,
            AnimationGroup group,
            int switchTime,
            double x,
            double y,
            double width  = 0,
            double height = 0,
            JyGame.GameData.CommonSettings.VoidCallBack callBack = null,
            int Z_INDEX     = CommonSettings.Z_SKILL,
            double opacity  = 1,
            bool removeLast = true,
            bool anchor     = true) //x、y为中心点
        {
            this.removeLast = removeLast;

            _image = new Image()
            {
                Height = height, Width = width, Opacity = opacity
            };
            //_image.CacheMode = new BitmapCache();


            _image.IsHitTestVisible = false;

            parentCanvas.Children.Add(_image);
            Canvas.SetLeft(_image, x);
            Canvas.SetTop(_image, y);
            Canvas.SetZIndex(_image, Z_INDEX);
            callback       = callBack;
            basex          = x;
            basey          = y;
            this.anchor    = anchor;
            ParentCanvas   = parentCanvas;
            Animation      = group;
            RepeatTime     = repeatTime;
            Timer          = new DispatcherTimer();
            Timer.Interval = TimeSpan.FromMilliseconds(switchTime);
            Timer.Tick    += new EventHandler(Timer_Tick);
            Timer.Start();
        }