public Ray(Vector2 origin, Vector2 direction)
        {
            Origin    = origin;
            Direction = direction;

            layer = DrawMgr.Layer.Foreground;

            Redpoint          = new Sprite(5, 5);
            Redpoint.pivot    = new Vector2(2.5f, 2.5f);
            Redpoint.position = Origin;

            DrawMgr.Add(this);
        }
Exemplo n.º 2
0
        public GameObject(Vector2 pos, string textureName, DrawMgr.Layer currLayer = DrawMgr.Layer.Playground)
        {
            Tuple <Texture, List <Animation> > spritesheet = GfxMgr.GetSpritesheet(textureName);

            if (texture == null)
            {
                texture = GfxMgr.GetSpritesheet(textureName).Item1;
            }
            texture          = spritesheet.Item1;
            animations       = spritesheet.Item2;
            currentAnimation = animations[0];
            Sprite           = new Sprite(currentAnimation.FrameWidth, currentAnimation.FrameHeight);
            Sprite.pivot     = new Vector2(Sprite.Width / 2, Sprite.Height / 2);
            Sprite.position  = pos;
            IsActive         = true;
            layer            = currLayer;
        }