//------------------------------------------------------------------------------ // Method: SetPositionMode // Author: Neil Holmes // Summary: allows user to set a different position mode after the initial setup //------------------------------------------------------------------------------ public void SetPositionMode(ICMessagePosition positionMode) { this.positionMode = positionMode; }
//------------------------------------------------------------------------------ // Constructor: ICMessagePopUp // Author: Neil Holmes // Summary: Constructor - prepares the message pop up system //------------------------------------------------------------------------------ public ICMessagePopUp(Game game, GraphicsDeviceManager graphicsDeviceManager, ICMessagePosition positionMode, ICMessageScale scale) { // create a content manager to handle loading the textures we need ContentManager content = new ContentManager(game.Services); // store the graphics device for future reference this.graphicsDevice = game.GraphicsDevice; // store the position mode that we are using this.positionMode = positionMode; // store the scale we are using if (scale == ICMessageScale.normal) displayScale = 1.0f; else displayScale = 0.5f; // create a sprite batch for rendering spriteBatch = new SpriteBatch(graphicsDevice); // load the achievement display textures badgeTexture = content.Load<Texture2D>(@"Content\ICMessages\Badge"); bannerTexture = content.Load<Texture2D>(@"Content\ICMessages\Shadow"); // store the size of the badge graphic badgeSize = badgeTexture.Height; // load the message fonts if (scale == ICMessageScale.normal) { titleFont = content.Load<SpriteFont>(@"Content\ICMessages\titleFont"); messageFont = content.Load<SpriteFont>(@"Content\ICMessages\MessageFont"); } else { titleFont = content.Load<SpriteFont>(@"Content\ICMessages\titleFontSmall"); messageFont = content.Load<SpriteFont>(@"Content\ICMessages\MessageFontSmall"); } // nothing to display yet! display = false; // set the message display stage to 'idle' so nothing is displayed this.stage = MessageStage.idle; }