示例#1
0
文件: Bar.cs 项目: preetum/archive
 public Bar(Vector2 loc, int w, int h)
 {
     Location  = new Point((int)loc.X, (int)loc.Y);
     Width     = w;
     Height    = h;
     Value     = 1;
     rectPoly  = new RectPoly(loc, Width, Height);
     ForeColor = Color.Blue;
     BackColor = Color.Wheat;
 }
示例#2
0
        public SolidButton(Vector2 minPos, float width, float height)
        {
            fontStr  = "font1";
            w        = width;
            h        = height;
            pos      = minPos;
            rectPoly = new RectPoly(minPos, width, height);
            tex      = ResourceManager.Resources["pixel"];

            currColor = InactiveColor;

            MouseOver     += new MouseOverEventHandler(Button_MouseOver);
            MouseLeftDown += new MouseClickEventHandler(SolidButton_MouseLeftDown);
        }
示例#3
0
文件: World.cs 项目: preetum/archive
        public IEnumerable <Actor> QueryPoint(Vector2 point)
        {
            RectPoly pRect = new RectPoly(point, 0, 0, 0);

            var tile = TileGrid[TileGrid.ScreenToUV(point)];

            var potCollides = tile.ProximityActors.CloneToList();
            var collideSet  = new HashSet <Actor>(potCollides);

            foreach (var actor in collideSet)
            {
                if (CollisionTester.TestPointInside(point, actor.GetBoundingPoly()))
                {
                    yield return(actor);
                }
            }
        }