/// <summary> /// Загрузка спрайтов игрока и звуков /// </summary> public void LoadContent() { picture = GameData.Instance.content.Load<Texture2D>("Images/winnie"); ImageRenderComponent irc = new ImageRenderComponent("player", this, ref picture); addComponent(irc); // Установить размер объекта Size = new Vector2(picture.Width, picture.Height); // TODO может быть перенести в конструктор компонента? KeyboardInputComponent kic = new KeyboardInputComponent("KeyboardInputComponent", this); addComponent(kic); }
/// <summary> /// Загрузка спрайтов игрока и звуков /// </summary> public void LoadContent() { picture = GameData.Instance.content.Load <Texture2D>("Images/winnie"); ImageRenderComponent irc = new ImageRenderComponent("player", this, ref picture); addComponent(irc); // Установить размер объекта Size = new Vector2(picture.Width, picture.Height); // TODO может быть перенести в конструктор компонента? KeyboardInputComponent kic = new KeyboardInputComponent("KeyboardInputComponent", this); addComponent(kic); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here //image = Content.Load<Texture2D>("Images/winnie"); gd.player.LoadContent(); Texture2D t = Content.Load<Texture2D>("Images/platform"); ImageRenderComponent irc = new ImageRenderComponent("platform", platform, ref t); platform.addComponent(irc); // Установить размер объекта platform.Size = new Vector2(t.Width, t.Height); // TODO может быть перенести в конструктор компонента? platform.Position = new Vector2(50.0f, 400.0f); }