public GameModeScene(IGameScreenManager manager) : base(manager) { services = (SCSServices)manager.Game.Services.GetService(typeof(SCSServices)); resourceManager = (IResourceManager)manager.Game.Services.GetService(typeof(IResourceManager)); }
public StringDebuger(Game game) : base(game) { dict = new Dictionary<String, Vector2>(); services = (SCSServices)game.Services.GetService(typeof(SCSServices)); font = game.Content.Load<SpriteFont>("debug"); }
public TBGamePlayScene(IGameScreenManager manager) : base(manager) { services = (SCSServices)manager.Game.Services.GetService(typeof(SCSServices)); resourceManager = (IResourceManager)manager.Game.Services.GetService(typeof(IResourceManager)); GameManager = new GameManagerImpl(manager.Game); Components.Add(GameManager); InputLayer = new DefaultInputLayer(manager.Game); InputLayer.onInit(); }
public void onInit() { services = (SCSServices)Game.Services.GetService(typeof(SCSServices)); resourceManager = (IResourceManager)Game.Services.GetService(typeof(IResourceManager)); controller = new Controller(Game); controller.onInit(); btnSpace = new Button(Game, services.SpriteBatch, resourceManager.GetResource<Texture2D>(Shared.Resources.ctrlButtonSpace), resourceManager.GetResource<Texture2D>(Shared.Resources.ctrlButtonSpace)); btnSpace.Canvas.Bound.Position = new Vector2(622, 392); btnSpace.FitSizeByImage(); controller.OnLeftFreeTap += new ControlEventHandler(btnUp_OnLeftFreeTap); controller.OnRightFreeTap += new ControlEventHandler(controller_OnRightFreeTap); controller.OnUpFreeTap += new ControlEventHandler(controller_OnUpFreeTap); controller.OnDownFreeTap += new ControlEventHandler(controller_OnDownFreeTap); btnSpace.OnPressed += new ButtonEventHandler(btnSpace_onClick); dispatcher.AddTarget(controller); controlManager.Add(btnSpace); }
public static void Initialize(Game game) { BoomMissionManager = new TBBoomMissionManager(game); Game = game; Services = (SCSServices)game.Services.GetService(typeof(SCSServices)); ResourceManager = (IResourceManager)game.Services.GetService(typeof(IResourceManager)); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); scsServices = new SCSServices(this, spriteBatch); Services.AddService(typeof(SCSServices), scsServices); IResourceManager resourceManager = new SCSResourceManager(this.Content); this.Services.AddService(typeof(IResourceManager), resourceManager); StringDebuger debuger = new StringDebuger(this); Components.Add(debuger); Global.isMusicOff = SaveLoadGame.LoadSoundVolume(); // Global Global.Initialize(this); Components.Add(Global.BoomMissionManager); // Init Grid Grid.Grid.game = this; // Init Gesture Manager and initialize detector Global.GestureManager = DefaultGestureHandlingFactory.Instance.CreateManager(this); DefaultGestureHandlingFactory.Instance.InitDetectors(Global.GestureManager); // Init all game factory InitFactory(); AddSpriteData(); // Begin with Choose Scene BoomGame.Scene.MenuScene menu = Global.BoomMissionManager.Bank.GetScreen(Shared.Macros.S_MENU, true) as BoomGame.Scene.MenuScene; menu.onInit(); Global.BoomMissionManager.AddExclusive(menu); }
public Button(Game game, ISprite background) : base(game) { this.services = game.Services.GetService(typeof(SCSServices)) as SCSServices; this.Background = background; }
public virtual void onInit() { scsServices = (SCSServices)this.Game.Services.GetService(typeof(SCSServices)); resourceManagement = (IResourceManager)this.Game.Services.GetService(typeof(IResourceManager)); }