Jump to content
  • Advertisement
Sign in to follow this  
Zild

XNA Inheritance

This topic is 3654 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[EDIT - Fixed it. Was something totally different. Again. Am now certifiably blind.] Hi all, I've been working through Chad Carter's (SAM'S) "XNA Unleashed" and am almost at the end, but I appear to be struggling with an inheritance issue. The project consists of a public sealed class Utility with the public static method GetTitleSafeArea (which returns a rectangle describing the inner 85% of the screen on XBOX, or the entire screen on PC). There is also a public abstract partial class GameState that calls the GetTitleSafeArea method and stores the result in a protected member variable TitleSafeArea. Then there is a public partial class BaseGameState that inherits from GameState. Finally there is a public sealed class PlayingState that inherits from BaseGameState. This class uses the TitleSafeArea variable, but by the time this class gets hold of it the values are all zero. The code compiles and runs, but since the TitleSafeArea is now a 0 by 0 rectangle it is not very useful! Any thoughts on what may be going wrong? I have tried comparing my code to the files on the book's CD, but have yet to find the cause of the problem. I have also tried making TitleSafeArea a public method, also to no avail. Any help would be greatly appreciated... [Edited by - Zild on September 20, 2008 9:51:43 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!