protected override void Initialize() { graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; #if (!PLT_WINP) IsMouseVisible = true; #endif Shopkeeper = new ShopKeeper(); Filemanager = new FileManager(); Filemanager.Initialize(); core_screen_constant_width = Shopkeeper.gamescreen_width; core_screen_constant_height = Shopkeeper.gamescreen_height; core_screen_scale_Width = Window.ClientBounds.Width / core_screen_constant_width; core_screen_scale_height = Window.ClientBounds.Height / core_screen_constant_height; base.Initialize(); }
public Menu(ContentManager _content, GraphicsDevice _graphics, SpriteBatch _spritebatch, ShopKeeper _shopkeeper, FileManager _filemanager, float _const_width, float _const_height, float _scale_width, float _scale_height) { content = _content; graphics = _graphics; spriteBatch = _spritebatch; Shopkeeper = _shopkeeper; Filemanager = _filemanager; Collisioncourse = new CollisionCourse(); TouchPanel.EnabledGestures = GestureType.Tap; core_screen_constant_width = _const_width; core_screen_constant_height = _const_height; scaleX = _scale_width; scaleY = _scale_height; active_title = true; fontScore = content.Load <SpriteFont>(Shopkeeper.font_score); grid_chain_position_main = Shopkeeper.grid_chain_position_main; grid_chain_position_upper1 = Shopkeeper.grid_chain_position_upper1; grid_chain_position_upper2 = Shopkeeper.grid_chain_position_upper2; grid_chain_position_lower1 = Shopkeeper.grid_chain_position_lower1; grid_chain_position_lower2 = Shopkeeper.grid_chain_position_lower2; grid_selector_position_1 = Shopkeeper.grid_selector_position_1; grid_selector_position_2 = Shopkeeper.grid_selector_position_2; grid_selector_position_3 = Shopkeeper.grid_selector_position_3; grid_selector_position_4 = Shopkeeper.grid_selector_position_4; grid_selector_position_5 = Shopkeeper.grid_selector_position_5; texture_background_title_0 = content.Load <Texture2D>(Shopkeeper.texture_background_title0); texture_background_title_1 = content.Load <Texture2D>(Shopkeeper.texture_background_title1); texture_background_title_2 = content.Load <Texture2D>(Shopkeeper.texture_background_title2); texture_background_title_3 = content.Load <Texture2D>(Shopkeeper.texture_background_title3); texture_background_menu_0 = content.Load <Texture2D>(Shopkeeper.texture_background_menu0); texture_background_menu_1 = content.Load <Texture2D>(Shopkeeper.texture_background_menu1); texture_background_menu_2 = content.Load <Texture2D>(Shopkeeper.texture_background_menu2); texture_background_menu_3 = content.Load <Texture2D>(Shopkeeper.texture_background_menu3); texture_grid_bump = content.Load <Texture2D>(Shopkeeper.texture_grid_bump); texture_grid_options = content.Load <Texture2D>(Shopkeeper.texture_grid_options); texture_grid_editor = content.Load <Texture2D>(Shopkeeper.texture_grid_editor); texture_grid_endless = content.Load <Texture2D>(Shopkeeper.texture_grid_endless); texture_grid_grass = content.Load <Texture2D>(Shopkeeper.texture_grid_grass); texture_grid_vulcano = content.Load <Texture2D>(Shopkeeper.texture_grid_vulcano); texture_grid_sky = content.Load <Texture2D>(Shopkeeper.texture_grid_sky); texture_grid_desert = content.Load <Texture2D>(Shopkeeper.texture_grid_desert); texture_grid_beach = content.Load <Texture2D>(Shopkeeper.texture_grid_beach); texture_grid_snow = content.Load <Texture2D>(Shopkeeper.texture_grid_snow); texture_grid_mountain = content.Load <Texture2D>(Shopkeeper.texture_grid_mountain); texture_grid_mashine = content.Load <Texture2D>(Shopkeeper.texture_grid_mashine); texture_grid_forest = content.Load <Texture2D>(Shopkeeper.texture_grid_forest); texture_grid_aurora = content.Load <Texture2D>(Shopkeeper.texture_grid_aurora); texture_grid_space = content.Load <Texture2D>(Shopkeeper.texture_grid_space); texture_grid_selector = content.Load <Texture2D>(Shopkeeper.texture_grid_selector); texture_button_editor = content.Load <Texture2D>(Shopkeeper.texture_menu_button_editor); texture_button_highscore = content.Load <Texture2D>(Shopkeeper.texture_menu_button_highscore); texture_name_act1 = content.Load <Texture2D>(Shopkeeper.texture_menu_name_act1); texture_name_act2 = content.Load <Texture2D>(Shopkeeper.texture_menu_name_act2); texture_name_act3 = content.Load <Texture2D>(Shopkeeper.texture_menu_name_act3); texture_name_act4 = content.Load <Texture2D>(Shopkeeper.texture_menu_name_act4); texture_name_act5 = content.Load <Texture2D>(Shopkeeper.texture_menu_name_act5); texture_name_options = content.Load <Texture2D>(Shopkeeper.texture_menu_name_options); texture_name_editor = content.Load <Texture2D>(Shopkeeper.texture_menu_name_editor); texture_name_endless = content.Load <Texture2D>(Shopkeeper.texture_menu_name_endless); texture_name_grass = content.Load <Texture2D>(Shopkeeper.texture_menu_name_grass); texture_name_vulcano = content.Load <Texture2D>(Shopkeeper.texture_menu_name_vulcano); texture_name_sky = content.Load <Texture2D>(Shopkeeper.texture_menu_name_sky); texture_name_desert = content.Load <Texture2D>(Shopkeeper.texture_menu_name_desert); texture_name_beach = content.Load <Texture2D>(Shopkeeper.texture_menu_name_beach); texture_name_snow = content.Load <Texture2D>(Shopkeeper.texture_menu_name_snow); texture_name_mountain = content.Load <Texture2D>(Shopkeeper.texture_menu_name_mountain); texture_name_mashine = content.Load <Texture2D>(Shopkeeper.texture_menu_name_mashine); texture_name_forest = content.Load <Texture2D>(Shopkeeper.texture_menu_name_forest); texture_name_aurora = content.Load <Texture2D>(Shopkeeper.texture_menu_name_aurora); texture_name_space = content.Load <Texture2D>(Shopkeeper.texture_menu_name_space); texture_name_unknown = content.Load <Texture2D>(Shopkeeper.texture_menu_name_unknown); Set_Score(); renderTarget = new RenderTarget2D(graphics, (int)core_screen_constant_width, (int)core_screen_constant_height); Collisioncourse.InserGreymark(texture_grid_bump, (int)(grid_selector_position_1.Y), (int)((grid_selector_position_2.Y + texture_grid_selector.Height)), new Vector2(grid_selector_position_1.X, grid_selector_position_1.Y), new Vector2(grid_selector_position_2.X, grid_selector_position_2.Y), new Vector2(grid_selector_position_3.X, grid_selector_position_3.Y), new Vector2(grid_selector_position_4.X, grid_selector_position_4.Y), new Vector2(grid_selector_position_5.X, grid_selector_position_5.Y)); }