Exemplo n.º 1
0
        // ////////////////////////////// //
        //          Constructor           //
        // ////////////////////////////// //

        /// initialize a new, empty socket with blank content;
        /// calls the derived-class specific version of InitEmptySocket()
        protected ButtonSlot(ButtonLayer parent, Vector2 position)
        {
            ParentLayer = parent;
            Position    = position;

            AssociatedButtons = new Dictionary <string, T>();
        }
Exemplo n.º 2
0
        public ChestIconBase(ButtonLayer parent, Vector2 position, Texture2D button_bg,
                             float base_alpha  = 0.75f,
                             float focus_alpha = 1.0f,
                             float alpha_step  = 0.01f) : base(parent, position, button_bg)
        {
            // BaseAlpha = base_alpha;
            // maxAlpha = focus_alpha.Clamp(BaseAlpha, 1.0f);
            //
            // alpha_step = (BaseAlpha == maxAlpha) ? 0 : alpha_step.Clamp(0.001f, (maxAlpha - BaseAlpha));

            // Alpha = BaseAlpha;
        }
Exemplo n.º 3
0
        ///<summary>
        /// Create an empty socket at the given position</summary>
        public TextButtonBase
            (ButtonLayer parent, Vector2 position,
            float base_scale  = 0.75f,
            float focus_scale = 1.0f,
            float scale_step  = 0.05f
            ) : base(parent, position)
        {
            posMod = Position;
            // 30 is honestly kind of a ridiculously high limit;
            // I don't think I saw any text-scaling values go higher
            // than 4 in the vanilla code.
            _minScale = base_scale.Clamp(0.5f, 30.0f);
            _maxScale = focus_scale.Clamp(_minScale, 30.0f);


            scaleStep = (_minScale == _maxScale) ? 0 :
                        scale_step;

            Scale = base_scale;
        }
Exemplo n.º 4
0
 public IconButtonBase(ButtonLayer parent, Vector2 position, Texture2D button_bg) : base(parent, position)
 {
     ButtonBackground = button_bg;
 }