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

            v = Vector2.Transform(v, Matrix.CreateTranslation(-RO) * Matrix.CreateRotationZ(-Rotate) * Matrix.CreateTranslation(RO));
            return(Bound.Contains(Method2D.VtP(v)));
        }