Beispiel #1
0
        public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap, string fontName)
        {
            _isPressTap = isPressTap;
            this.effectManager = Core.topEffectManager;

            _color = color;
            AddChild (button = new FSliceButton (width, height, _color.path, _color.path));

            //button.SetPosition(0.25f,0.33f);//pixel perfect?

            AddChild (mainLabel = new DualLabel (fontName, title, Color.white, Colors.TEXT_SHADOW));
            mainLabel.y = 2.5f;

            if (_isPressTap) {
                button.SignalPress += (b) => DoTap ();
            } else {
                button.SignalRelease += (b) => DoTap ();
            }

            _overHighlight = new FSliceSprite ("UI/ButtonHighlight", width, height, 12, 12, 12, 12);
            _overHighlight.alpha = 0.45f;

            ListenForUpdate (HandleUpdate);

            UpdateEnabled ();
        }
Beispiel #2
0
 public DualLabel AddLabel(DualLabel label)
 {
     labels.Add (label);
     label.SetAnchor (0.0f, 0.5f);
     AddChild (label);
     return label;
 }
Beispiel #3
0
 public DualLabel RemoveLabel(DualLabel label)
 {
     label.RemoveFromContainer ();
     labels.Remove (label);
     return label;
 }
Beispiel #4
0
        public DualLabel AddSubLabel(DualLabel subLabel, float mainOffsetY, float subOffsetY)
        {
            this.subLabel = subLabel;
            AddChild (subLabel);

            mainLabel.y += mainOffsetY;
            subLabel.y += subOffsetY;

            UpdateEnabled ();

            return subLabel;
        }