/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { // TODO: Add your initialization code here // 新增一張白色、不透明紋理圖 (Width * Height) /* Texture_Bar = new Texture2D(game.GraphicsDevice, Width, Height, true, SurfaceFormat.Color); Color[] color = new Color[Width * Height]; for (int i = 0; i < Width * Height; i++) color[i] = new Color(255, 255, 255, 255); Texture_Bar.SetData(color); // 白色 不透明 紋理圖 Dest1 = new Rectangle( // 前景區域 (int)Pos.X, (int)Pos.Y, (int)(Texture_Bar.Width * score * (1.0f / score_Max)), Texture_Bar.Height); Dest2 = new Rectangle( // 背景區域 (int)(Pos.X + Texture_Bar.Width * score * (1.0f / score_Max)), (int)Pos.Y, (int)(Texture_Bar.Width * (score_Max - score) * (1.0f / score_Max)), Texture_Bar.Height); Src1 = new Rectangle(0, 0, (int)(Texture_Bar.Width * score * (1.0f / score_Max)), Texture_Bar.Height); Src2 = new Rectangle(0, 0, (int)(Texture_Bar.Width * (score_Max - score) * (1.0f / score_Max)), Texture_Bar.Height); */ debugMsg = new DebugMsg(); base.Initialize(); LoadContent(); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { // TODO: Add your initialization code here debugMsg = new DebugMsg(); base.Initialize(); LoadContent(); }