Exemple #1
0
        /// <summary>
        /// Renders the arrow
        /// </summary>
        public override void OnFrameRender()
        {
            float width     = 60;
            float halfWidth = width / 2;
            float initY     = mPos.Y + 118;
            float initX     = mPos.X + 48;

            // Calc full drawing rect
            mDrawRectangle = new SMX.Maths.Rectangle((int)(initX - halfWidth), (int)(initY - mHeight), (int)width, (int)mHeight);

            // Draw as many tiles as necessary to cover the area
            int textureHeight = 64;
            int numdiv        = (int)((float)mDrawRectangle.Height / (float)textureHeight);
            int startY        = (int)initY;

            for (int i = 0; i < numdiv; i++)
            {
                RendererBase.Ref.DrawSprite(mTextureResourceName, 0, 0, 21, 32, mDrawRectangle.X, startY - textureHeight, mDrawRectangle.Width, textureHeight);
                startY -= textureHeight;
            }

            // Draw remaining
            int remaining = startY - mDrawRectangle.Y;

            RendererBase.Ref.DrawSprite(mTextureResourceName, 0, 0, 21, 32, mDrawRectangle.X, mDrawRectangle.Y, mDrawRectangle.Width, remaining);

            // Draw Arrow ending
            RendererBase.Ref.DrawSprite(mTextureEndingResourceName, 0, 0, 32, 32, mDrawRectangle.X - 8, mDrawRectangle.Y - 20, 64, 64);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pText"></param>
        /// <param name="pSize"></param>
        /// <param name="pX"></param>
        /// <param name="pY"></param>
        /// <param name="pColor"></param>
        public override void DrawText(string pText, eTextSize pSize, int pX, int pY, SMX.Maths.Color4 pColor)
        {
            System.Drawing.Font font  = new Font("Arial", (int)pSize, FontStyle.Bold);
            SolidBrush          brush = new SolidBrush(pColor.ToGDI());

            SMX.Maths.Rectangle r = GetScreenCoords(pX, pY, 0, 0);
            mGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear;
            mGraphics.DrawString(pText, font, brush, new PointF(r.X, r.Y));
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        public void RefreshDrawRectangle()
        {
            if (mSourceRectIdx >= mSourceRects[mState].Count)
            {
                mSourceRectIdx = 0;
            }

            var rect = mSourceRects[mState][mSourceRectIdx];

            mDrawRectangle = new SMX.Maths.Rectangle((int)mPos.X, (int)mPos.Y, (int)((float)rect.Width * mScaleFactorX), (int)((float)rect.Height * mScaleFactorY));
        }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 public void RefreshDrawRectangle()
 {
     SMX.Maths.Rectangle rect = CurrentSourceRect;
     mDrawRectangle = new SMX.Maths.Rectangle((int)mPos.X, (int)mPos.Y, (int)((float)rect.Width * mScaleFactorX), (int)((float)rect.Height * mScaleFactorY));
 }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        public void RefreshDrawRectangle()
        {
            var rect = mSpriteRectangles[mBallType][mBallSize];

            mDrawRectangle = new SMX.Maths.Rectangle((int)mPos.X, (int)mPos.Y, (int)((float)rect.Width * mScaleFactorX), (int)((float)rect.Height * mScaleFactorY));
        }
Exemple #6
0
        /// <summary>
        ///
        /// </summary>
        public void RefreshDrawRectangle()
        {
            var rect = mSourceRects[mType][mSourceRectIdx];

            mDrawRectangle = new SMX.Maths.Rectangle((int)mPos.X, (int)mPos.Y, (int)((float)rect.Width * mScaleFactorX), (int)((float)rect.Height * mScaleFactorY));
        }