Пример #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,TOColors.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();
    }
Пример #2
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, TOColors.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();
    }
Пример #3
0
 public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap)
     : this(title,width,height,color,isPressTap,TOFonts.MEDIUM_BOLD)
 {
 }
Пример #4
0
 public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap) : this(title, width, height, color, isPressTap, TOFonts.MEDIUM_BOLD)
 {
 }