Exemplo n.º 1
0
        public static Texture CreateForTextureRegionSize(TextureRegion pTextureRegion, TextureOptions pTextureOptions)
        {
            int loadingScreenWidth  = pTextureRegion.GetWidth();
            int loadingScreenHeight = pTextureRegion.GetHeight();

            return(new Texture(MathUtils.NextPowerOfTwo(loadingScreenWidth), MathUtils.NextPowerOfTwo(loadingScreenHeight), pTextureOptions));
        }
Exemplo n.º 2
0
        protected void Init(Camera pCamera, TextureRegion pTextureRegion, float pDuration, float pScaleFrom, float pScaleTo)
        {
            Sprite loadingScreenSprite = new Sprite(pCamera.GetMinX(), pCamera.GetMinY(), pCamera.GetWidth(), pCamera.GetHeight(), pTextureRegion);

            if (pScaleFrom != 1 || pScaleTo != 1)
            {
                loadingScreenSprite.SetScale(pScaleFrom);
                loadingScreenSprite.AddShapeModifier(new ScaleModifier(pDuration, pScaleFrom, pScaleTo, IEaseFunction.DEFAULT));
            }

            this.GetTopLayer().AddEntity(loadingScreenSprite);
        }
Exemplo n.º 3
0
        // ===========================================================
        // Constructors
        // ===========================================================

        public BaseOnScreenControl(/* final */ int pX, /* final */ int pY, /* final */ Camera pCamera, /* final */ TextureRegion pControlBaseTextureRegion, /* final */ TextureRegion pControlKnobTextureRegion, /* final */ float pTimeBetweenUpdates, /* final */ IOnScreenControlListener pOnScreenControlListener)
        {
            this.SetCamera(pCamera);

            this.mOnScreenControlListener = pOnScreenControlListener;
            /* Create the control base. */

            /*
             * this.mControlBase = new Sprite(pX, pY, pControlBaseTextureRegion) {
             *  public override bool OnAreaTouched(/* final * / TouchEvent pSceneTouchEvent, /* final * / float pTouchAreaLocalX, /* final * / float pTouchAreaLocalY) {
             *      return BaseOnScreenControl.this.OnHandleControlBaseTouched(pSceneTouchEvent, pTouchAreaLocalX, pTouchAreaLocalY);
             *  }
             * };
             */
            this.mControlBase = new BaseOnScreenControlBaseSprite(this, pX, pY, pControlBaseTextureRegion);

            /* Create the control knob. */
            this.mControlKnob = new Sprite(0, 0, pControlKnobTextureRegion);
            this.OnHandleControlKnobReleased();

            /* Register listeners and add objects to this HUD. */
            this.SetOnSceneTouchListener(this);
            this.RegisterTouchArea(this.mControlBase);

            /*
             * this.RegisterUpdateHandler(new TimerHandler(pTimeBetweenUpdates, true, new ITimerCallback() {
             *  public override void OnTimePassed(/* final * / TimerHandler pTimerHandler) {
             *      BaseOnScreenControl.this.mOnScreenControlListener.onControlChange(BaseOnScreenControl.this, BaseOnScreenControl.this.mControlValueX, BaseOnScreenControl.this.mControlValueY);
             *  }
             * }));
             * //*/
            this.RegisterUpdateHandler(new TimerHandler(pTimeBetweenUpdates, true, new BaseOnScreenControlTimerCallback(this)));

            /* final */
            ILayer bottomLayer = this.GetBottomLayer();

            bottomLayer.AddEntity(this.mControlBase);
            bottomLayer.AddEntity(this.mControlKnob);

            this.SetTouchAreaBindingEnabled(true);
        }
Exemplo n.º 4
0
 public BaseOnScreenControlBaseSprite(BaseOnScreenControl parentControl, float pX, float pY, TextureRegion pControlBaseTextureRegion)
     : base(pX, pY, pControlBaseTextureRegion)
 {
     _this = parentControl;
 }
Exemplo n.º 5
0
        // ===========================================================
        // Constants
        // ===========================================================

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        public static Texture CreateForTextureSourceSize(TextureRegion pTextureRegion)
        {
            return(CreateForTextureRegionSize(pTextureRegion, TextureOptions.DEFAULT));
        }
Exemplo n.º 6
0
        protected override float GetY2()
        {
            TextureRegion textureRegion = this.GetTextureRegion();

            return((float)(textureRegion.GetTexturePositionY() + textureRegion.GetHeight()) / textureRegion.GetTexture().GetHeight());
        }
Exemplo n.º 7
0
        protected override float GetX2()
        {
            TextureRegion textureRegion = this.GetTextureRegion();

            return((float)(textureRegion.GetTexturePositionX() + textureRegion.GetWidth()) / textureRegion.GetTexture().GetWidth());
        }
Exemplo n.º 8
0
        // ===========================================================
        // Constants
        // ===========================================================

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        public TextureRegionBuffer(TextureRegion pTextureRegion, int pDrawType)
            : base(pTextureRegion, pDrawType)
        {
        }
        // ===========================================================
        // Constants
        // ===========================================================

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        public TextureRegionBuffer(TextureRegion pTextureRegion, int pDrawType)
            : base(pTextureRegion, pDrawType)
        {
        }
Exemplo n.º 10
0
 public SplashScene(Camera pCamera, TextureRegion pTextureRegion, float pDuration, float pScaleFrom, float pScaleTo)
     : base(1)
 {
     Init(pCamera, pTextureRegion, pDuration, pScaleFrom, pScaleTo);
 }
Exemplo n.º 11
0
        // ===========================================================
        // Constants
        // ===========================================================

        // ===========================================================
        // Fields
        // ===========================================================

        // ===========================================================
        // Constructors
        // ===========================================================

        public SplashScene(Camera pCamera, TextureRegion pTextureRegion)
            : base(1)
        {
            Init(pCamera, pTextureRegion, -1, 1, 1);
        }