コード例 #1
0
 public Minigame3Element(float x, float y, float width, float height, LabelStyle questionStyle, LabelStyle remainingVotesStyle, LabelStyle playerNameStyle, LabelStyle alertStyle, LabelStyle choiceLabelStyle, ButtonStyle buttonStyle, ButtonStyle choiceButtonStyle)
 {
     bounds                   = new Rectangle(x, y, width, height);
     this.questionStyle       = questionStyle;
     this.remainingVotesStyle = remainingVotesStyle;
     this.playerNameStyle     = playerNameStyle;
     this.alertStyle          = alertStyle;
     this.choiceLabelStyle    = choiceLabelStyle;
     this.buttonStyle         = buttonStyle;
     this.choiceButtonStyle   = choiceButtonStyle;
     rootElement              = new Pivot();
     AddChild(rootElement);
     SetXY(x, y);
 }
コード例 #2
0
        public SpriteButton(float x, float y, float width, float height, string buttonText, Sprite sprite, ButtonStyle buttonStyle, Action onClick = null, Action onMouseEnter = null, Action onMouseLeave = null, Action onMousePress = null, Action onMouseRelease = null)
            : base(Mathf.Ceiling(width), Mathf.Ceiling(height), false)
        {
            bounds           = new Rectangle(x, y, width, height);
            ButtonText       = buttonText;
            Sprite           = sprite;
            this.buttonStyle = buttonStyle;

            OnClick        += onClick;
            OnMouseEnter   += onMouseEnter;
            OnMouseLeave   += onMouseLeave;
            OnMousePress   += onMousePress;
            OnMouseRelease += onMouseRelease;

            SetXY(x, y);
            Draw();
        }