예제 #1
0
        public LColor GetColor(float r, float g, float b, float a)
        {
            if (a <= 0.1f)
            {
                return(alphaColor);
            }
            int hashCode = 1;

            hashCode = LSystem.Unite(hashCode, r);
            hashCode = LSystem.Unite(hashCode, g);
            hashCode = LSystem.Unite(hashCode, b);
            hashCode = LSystem.Unite(hashCode, a);
            LColor color = colorMap.Get(hashCode);

            if (color == null)
            {
                color = new LColor(r, g, b, a);
                colorMap.Put(hashCode, color);
            }
            return(color);
        }
예제 #2
0
        public virtual void MousePressed(GameTouch e)
        {
            /*if (isLock || isClose || !isLoad)
             * {
             *      return;
             * }*/
            if (isTranslate)
            {
                e.Offset(tx, ty);
            }
            int type   = e.Type;
            int button = e.GetButton();

            try
            {
                touchType.Put(type, true);
                touchButtonPressed  = button;
                touchButtonReleased = SysInput_Item.NO_BUTTON;
                TouchDown(e);

                /*if (!isClickLimit(e))
                 * {
                 *      updateTouchArea(LTouchArea_Event.DOWN, e.X, e.Y);
                 *      touchDown(e);
                 *      if (_touchListener != null && desktop != null)
                 *      {
                 *              _touchListener.DownClick(desktop.SelectedComponent, e.X, e.Y);
                 *      }
                 * }*/
                _lastTocuh.Set(e.X(), e.Y());
            }
            catch (System.Exception ex)
            {
                touchButtonPressed  = SysInput_Item.NO_BUTTON;
                touchButtonReleased = SysInput_Item.NO_BUTTON;
                //error("Screen mousePressed() exception", ex);
            }
        }