Sign in to follow this  

XNA Inheritance

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this