Exemple #1
0
 public GfxStr(string font, string text, Point pos, int edge)
 {
     Texture = Game1.content.Load <SpriteFont>(font);
     Text    = text;
     Edge    = edge;
     Bound   = new Rectangle(pos, Method2D.VtP(Texture.MeasureString(Text)) + new Point(2 * Edge, 2 * Edge));
 }
Exemple #2
0
        /// <summary>
        /// 만약 Gfx의 rotate값이 0이 아닐 경우, RContains 함수가 정확합니다. 다만, 보시다시피, 비싼 계산을 요구합니다.
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public bool RContains(Point p)
        {
            Vector2 v  = Method2D.PtV(p);
            Point   RO = new Point(Pos.X + (ROrigin.X * Bound.Width) / Texture.Width, Pos.Y + (ROrigin.Y * Bound.Height) / Texture.Height); //실제 회전중심의 위치를 잡습니다.

            v = Vector2.Transform(v, Matrix2D.Rotate(RO, -Rotate));
            return(Bound.Contains(Method2D.VtP(v)));
        }