/// <summary>Function to initialize local members.</summary> public override void Initialize() { // Set up displays clientBounds = engine.Window.ClientBounds; boardView = new Rectangle( 0, 0, clientBounds.Width - 300, clientBounds.Height); sidebarView = new Rectangle( boardView.Width, 0, 300, clientBounds.Height); // Create subcomponents // Model management boardView.X = 0; this.tacticalView = new TacticalView(boardView); // Sprite/sidebar managment this.sidebar = new Sidebar(new Rectangle(0, 0, 300, 1080)); // set up panning panningAllowed = true; // set up input settings panBuffer = 25; // set up drawing constraints targetFPS = 60; msBetweenFrames = 1000 / targetFPS; timeSinceLastDraw = 0; base.Initialize(); }
/// <summary> /// Constructor /// </summary> /// <param name="sprite"> /// The sprite to associate with the button.</param> /// <param name="positionBox"> /// The position the box occupies within it's parent /// container.</param> public Button(Texture2D texture, Point frameSize, Point sheetSize, Sidebar sidebar) : base(texture, frameSize, sheetSize, 0, Point.Zero) { this.sidebar = sidebar; }