public KeyboardInputLayer(Scene scene, Torch.Object parent) : base(scene, parent)
        {
            var keyboard = ((InputManager)scene.Game.Services.GetService(typeof(IInputService))).GetKeyboard();

            keyboard.KeyPressed  += HandleKeyDown;
            keyboard.KeyReleased += HandleKeyUp;
        }
示例#2
0
 public ImageObject(Microsoft.Xna.Framework.Game game, Torch.Object parent, string imageName) : base(game, parent)
 {
     Content         = (ContentManager)(Game.Services.GetService(typeof(ContentManager)));
     _imageName      = imageName;
     _image          = Content.Load <Texture2D>(imageName);
     SourceRectangle = new Rectangle(0, 0, _image.Width, _image.Height);
 }
示例#3
0
 public TextureObject(Microsoft.Xna.Framework.Game game, Torch.Object parent) : base(game, parent)
 {
     _texture = new Texture2D(GraphicsDevice, 1, 1);
 }
示例#4
0
 public SpriteObject(Microsoft.Xna.Framework.Game game, Torch.Object parent, string image) : base(game, parent, image)
 {
 }
示例#5
0
 public TextObject(Microsoft.Xna.Framework.Game game, Torch.Object parent) : base(game, parent)
 {
 }
示例#6
0
 public BackgroundLayer(Scene scene, Torch.Object parent, string image) : base(scene, parent)
 {
     Components.Add(new ImageObject(Game, this, image));
 }