Пример #1
0
 public EditableText(Actor actor, Clickable clickable, Color cursorColor, Color highlightColor) : base(actor)
 {
     this.textRenderer       = RequireComponent <BoundedTextRenderer>();
     this.clickable          = clickable;
     this.clickable.OnClick += OnClick;
     this.cursorColor        = cursorColor;
     this.highlightColor     = highlightColor;
 }
Пример #2
0
 public ButtonNinepatchHandler(Actor actor, NinepatchSheet hoverSheet, NinepatchSheet pressedSheet) : base(actor)
 {
     this.hoverSheet   = hoverSheet;
     this.pressedSheet = pressedSheet;
     this.clickable    = RequireComponent <Clickable>();
     this.renderer     = RequireComponent <NinepatchRenderer>();
     this.defaultSheet = this.renderer.Sheet;
 }
Пример #3
0
        public RadioButtonState(Actor actor, RadioButtonGroup radioButtonGroup, bool startFilled) : base(actor)
        {
            this.clickable          = RequireComponent <Clickable>();
            this.clickable.OnClick += OnClick;
            this.group              = radioButtonGroup;

            this.startFilled = startFilled;
        }
Пример #4
0
 public ButtonSpriteRenderer(Actor actor, SpriteSheet spriteSheet, IFrameAnimation frames) : base(actor)
 {
     this.clickable    = RequireComponent <Clickable>();
     this.boundingRect = RequireComponent <BoundingRect>();
     this.spriteSheet  = spriteSheet;
     this.frames       = frames;
     this.currentFrame = HoverSprite.Idle;
 }
Пример #5
0
        public SingleSelectable(Actor actor, SingleSelector selector) : base(actor)
        {
            this.clickable          = RequireComponent <Clickable>();
            this.clickable.OnClick += OnClick;
            this.selector           = selector;

            this.onSelect   += () => { };
            this.onDeselect += () => { };
        }
Пример #6
0
 public CheckboxRenderer(Actor actor, SpriteSheet spriteSheet, Image checkmark,
                         ICheckboxStateProvider checkboxState, Clickable clickable, IFrameAnimation animation) : base(actor)
 {
     this.boundingRect        = RequireComponent <BoundingRect>();
     this.checkboxState       = checkboxState;
     this.clickable           = clickable;
     this.checkboxSpriteSheet = spriteSheet;
     this.checkmark           = checkmark;
     this.animation           = animation;
 }
Пример #7
0
 public DropdownTrigger(Actor actor, DropdownContent content, SpriteSheet spriteSheet, IFrameAnimation frames,
                        NinepatchSheet backgroundSheet) : base(actor)
 {
     this.clickable               = RequireComponent <Clickable>();
     this.clickable.OnClick      += OnClick;
     this.content                 = content;
     this.content.onOptionSelect += OnOptionSelected;
     this.textRenderer            = RequireComponent <BoundedTextRenderer>();
     this.selectedItem            = content.FirstItem;
     this.textRenderer.Text       = " " + this.selectedItem.text; // awkward space character
     this.frames          = frames;
     this.spriteSheet     = spriteSheet;
     this.backgroundSheet = backgroundSheet;
     this.boundingRect    = RequireComponent <BoundingRect>();
 }
Пример #8
0
 public CheckboxState(Actor actor, bool startingValue = false) : base(actor)
 {
     this.clickable          = RequireComponent <Clickable>();
     this.clickable.OnClick += OnClick;
     IsChecked = startingValue;
 }
Пример #9
0
 public EditableText(Actor actor, Clickable clickable) : this(actor, clickable, Color.Black,
                                                              Color.CornflowerBlue)
 {
     // forwards to main ctor
 }
Пример #10
0
 public SimpleButtonRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.clickable    = RequireComponent <Clickable>();
 }
Пример #11
0
 public DoubleClickable(Actor actor) : base(actor)
 {
     this.clickable          = RequireComponent <Clickable>();
     this.clickable.OnClick += OnClick;
 }