3 Replies - 10870 Views - Last Post: 18 November 2012 - 11:47 AM

#1 d0nni  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 13-December 10

Microsoft.Xna.Framework.GameComponent

Posted 18 November 2012 - 11:00 AM

Hi,

I've a question to do with the Microsoft.Xna.Framework.GameComponent library.

in xna 3.1 was there a defination for base.Show() and for base.Hide() and if so what would this be now in xna 4.0

i'm working through a tutorial at the moment and for some reason this is the error i keep getting.

"'Microsoft.Xna.Framework.GameComponent' does not contain a definition for 'Show'"

I was looking through the microsoft library online for GameComponent and right enough i didnt see it.

could someone please share some insight about this?

Thanks,
D0nni

Is This A Good Question/Topic? 0
  • +

Replies To: Microsoft.Xna.Framework.GameComponent

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9392
  • View blog
  • Posts: 35,273
  • Joined: 12-June 08

Re: Microsoft.Xna.Framework.GameComponent

Posted 18 November 2012 - 11:10 AM

Yeah, I don't think those members are in there... can you show us the code that was working in 3.0 and not now in 4.0?

http://msdn.microsof...udio.40%29.aspx

http://www.dreaminco...show%3B-method/
Was This Post Helpful? 0
  • +
  • -

#3 d0nni  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 13-December 10

Re: Microsoft.Xna.Framework.GameComponent

Posted 18 November 2012 - 11:20 AM

It is just a theory of mine lol.

The code im using both base.Show(); and base.Hide(); is very similar to what the example of code is talked about by SixOfEleven in the forum link you provided there.

here are the librarys im using:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using WindowsGame1.CoreComponents;



this is the part of code:

       public override void Show()
        {
            menu.Position = new Vector2(
            (Game.window.ClientBounds.Width - menu.Width) / 2, 330);
            base.Show();
        }

        public override void Hide()
        {
            base.Hide();

Was This Post Helpful? 0
  • +
  • -

#4 d0nni  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 13-December 10

Re: Microsoft.Xna.Framework.GameComponent

Posted 18 November 2012 - 11:47 AM

haha sorted it, didnt change the class at the top to inherit the gamescreen stuff.

have a class gamescreen which has two virtual methods show and hide...

thanks for replying though
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1