コード例 #1
0
ファイル: EditableText.cs プロジェクト: notexplosive/machina
 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
ファイル: CheckboxState.cs プロジェクト: notexplosive/machina
 public CheckboxState(Actor actor, bool startingValue = false) : base(actor)
 {
     this.clickable          = RequireComponent <Clickable>();
     this.clickable.OnClick += OnClick;
     IsChecked = startingValue;
 }
コード例 #9
0
ファイル: EditableText.cs プロジェクト: notexplosive/machina
 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;
 }