Ejemplo n.º 1
0
 private void WiggleButtonCB(StressButton button, object userData)
 {
     mWiggleOn = !mWiggleOn;
 }
Ejemplo n.º 2
0
 private void StressDownButtonCB(StressButton button, object userData)
 {
     StressDown();
 }
Ejemplo n.º 3
0
        private void PreviousScreenButtonCB(StressButton button, object userData)
        {
            var demo = (StressTest)RB.Game;

            demo.PreviousScene();
        }
Ejemplo n.º 4
0
 private void StressUpButtonCB(StressButton button, object userData)
 {
     StressUp();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        public SceneStress()
        {
            Rect2i buttonRect;

            Vector2i pos = new Vector2i(12, RB.DisplaySize.height - 32);

            buttonRect      = new Rect2i(pos.x, pos.y, 87, 23);
            mPreviousButton = new StressButton(buttonRect, buttonRect, "Previous Test", (KeyCode)555, 0, PreviousScreenButtonCB);

            pos.x      += 100;
            buttonRect  = new Rect2i(pos.x, pos.y, 87, 23);
            mNextButton = new StressButton(buttonRect, buttonRect, "Next Test", (KeyCode)555, 0, NextScreenButtonCB);

            pos.x            += 100;
            buttonRect        = new Rect2i(pos.x, pos.y, 87, 23);
            mStressDownButton = new StressButton(buttonRect, buttonRect, "Stress Down", (KeyCode)555, 0, StressDownButtonCB);

            pos.x          += 100;
            buttonRect      = new Rect2i(pos.x, pos.y, 87, 23);
            mStressUpButton = new StressButton(buttonRect, buttonRect, "Stress Up", (KeyCode)555, 0, StressUpButtonCB);

            pos.x        += 100;
            buttonRect    = new Rect2i(pos.x, pos.y, 87, 23);
            mWiggleButton = new StressButton(buttonRect, buttonRect, "Toggle Wiggle", (KeyCode)555, 0, WiggleButtonCB);

            mButtons.Add(mNextButton);
            mButtons.Add(mPreviousButton);
            mButtons.Add(mStressDownButton);
            mButtons.Add(mStressUpButton);
            mButtons.Add(mWiggleButton);

            // Pregen some random positions and wiggles, and colors
            mRandomPos = new Vector2i[MAX_STRESS];
            for (int i = 0; i < MAX_STRESS; i++)
            {
                mRandomPos[i] = new Vector2i(
                    (int)Random.Range(-16, RB.DisplaySize.width),
                    (int)Random.Range(-16, RB.DisplaySize.height));
            }

            mRandomWiggle = new Vector2i[113];
            for (int i = 0; i < mRandomWiggle.Length; i++)
            {
                mRandomWiggle[i] = new Vector2i(Random.Range(-1, 2), Random.Range(-1, 2));
            }

            mRandomSprite = new int[MAX_STRESS];
            for (int i = 0; i < MAX_STRESS; i++)
            {
                mRandomSprite[i] = Random.Range(0, 4);
            }

            mRandomColor = new Color32[MAX_STRESS];
            for (int i = 0; i < MAX_STRESS; i++)
            {
                mRandomColor[i] = mPaletteLookup[Random.Range(1, mPaletteLookup.Length)];
            }

            mRandomRadius = new Vector2i[MAX_STRESS];
            for (int i = 0; i < MAX_STRESS; i++)
            {
                mRandomRadius[i] = new Vector2i(Random.Range(4, 64), Random.Range(4, 64));
            }
        }