public TileButton(float left, float top, string iconPath) { this.left = left; this.top = top; icon = new Sprite2D(0, 0, Utils.LoadTextures(iconPath)); iconHighlighter = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName(Consts.LIGHT))); }
private TileSpriteContainer() { allTiles = new Dictionary<char, Sprite2D>(); allTiles[Consts.SPACE] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(Consts.SPACE))); allTiles[Consts.BLANK] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(Consts.BLANK))); allTiles[Consts.OBSTACLE] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(Consts.OBSTACLE))); allTiles[Consts.LIGHT] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(Consts.LIGHT))); allTiles[Consts.LIGHT_BLUE] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(Consts.LIGHT_BLUE))); for (char c = 'A'; c <= 'Z'; c++) allTiles[c] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(c))); for (char c = '0'; c <= '9'; c++) allTiles[c] = new Sprite2D(Consts.TILE_WIDTH, Consts.TILE_HEIGHT, Utils.LoadTextures(Utilities.Utils.GetCharacterFileName(c))); }
public MenuOption(float left, float top, string text, string iconPath) { this.left = left; this.top = top; this.text = text; entityPhase = Phase.MENU; this.iconSprite = new Sprite2D(0, 0, Utils.LoadTextures(iconPath)); iconSpriteHighlighter = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName(Consts.LIGHT))); intensity = 0; }
private LogoPanel() { // Load background backgroundSprite = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName("B"))); // center_left = (Consts.SCREEN_WIDTH - GetWidth()) / 2f; center_top = 2 * Consts.LOGO_TOP; dx = (center_left - Consts.LOGO_LEFT) / Consts.LOGO_TRANSLATION_TIME; dy = (center_top - Consts.LOGO_TOP) / Consts.LOGO_TRANSLATION_TIME; left = center_left; top = center_top; }
public PlayerEntity(float left, float top, int width, int height, string playerName, string playerImage) { this.left = left; this.top = top; this.width = width; this.height = height; this.increasingScore = 0; this.entityPhase = Phase.IN_GAME_ACHIEVING_FINISHED; this.playerRecord = new PlayerRecord(); this.playerRecord.PlayerName = playerName; this.playerRecord.PlayerScore = 0; this.playerImage = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName(playerImage))); this.playerImageHighlighter = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName(Consts.LIGHT))); intensity = new float[Consts.MAX_NAME_LENGTH]; InitializeAnimating(); }
/// <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); // TODO: use this.Content to load your game content here Global.Content = Content; // Allow mouse //IsMouseVisible = true; cursor = CustomCusor.GetInstance(); // Initialize map gridMap = WordGrid.GetInstance(); //gridMap.Load(Content.Load<GridData>(Utils.GetMapFileName(Consts.DEFALT_MAP_NAME))); // Initialize dictionary dictionary = TrieDictionary.GetInstance(); dictionary.Load(Content.Load<string[]>(Utils.GetDictionaryFileName(Consts.DEFAULT_DICTIONARY_NAME))); // Initialize logo panel logoPanel = LogoPanel.GetInstance(); // Initialize menu menuContainer = MenuContainer.GetInstance(); // Initialize background background = new Sprite2D(0, 0, Utils.LoadTextures(Utils.GetImageFileName("Background"))); // Initialize notification notification = GameNotification.GetInstance(); // Initialize controller mouseController = MouseController.GetInstance(); keyboardController = KeyboardController.GetInstance(); // Initialize button backButton = new TileButton(25, 620, Utils.GetImageFileName("Back")); soundButton = new TileButton(70, 620, Utils.GetImageFileName("Sound")); // Load sound effects Global.clickSound = Content.Load<SoundEffect>(@"Sound\click"); Global.achieveSound = Content.Load<SoundEffect>(@"Sound\achieve"); Global.themeSong = Content.Load<Song>(@"Sound\theme"); Global.UpdatePhase(Phase.MENU_LOADING); }
private CustomCusor() { icon = new Sprite2D(0, 0, Utils.LoadTextures(@"Cursor\cursor_hand")); }