@Override public void present(float deltaTime) { Graphics g = game.getGraphics(); g.clear(Color.BLACK); g.drawPixmap(Assets.logo, LOGO_IMAGE_X, LOGO_IMAGE_Y); g.drawPixmap(Assets.mainMenu, MENU_IMAGE_X, MENU_IMAGE_Y); if (Settings.soundEnabled) g.drawPixmap( Assets.buttons, BUTTON_SOUND_X, BUTTON_SOUND_Y, Assets.BUTTON_SOUND_ON_SCRX, Assets.BUTTON_SOUND_ON_SCRY, Assets.BUTTON_WIDTH, Assets.BUTTON_HEIGHT); else g.drawPixmap( Assets.buttons, BUTTON_SOUND_X, BUTTON_SOUND_Y, Assets.BUTTON_SOUND_OFF_SCRX, Assets.BUTTON_SOUND_OFF_SCRY, Assets.BUTTON_WIDTH, Assets.BUTTON_HEIGHT); if (DEBUG_BOUNDS == true) { drawDebugBounds(g, mBounds); } }
public MainMenuScreen(Game game) { super(game); Graphics g = game.getGraphics(); // Defining the BOUNDS where some CLICK_EVENT should happen mBounds = new SparseArray<Bounds>(); mBounds.append( 0, new Bounds( CLICK_SOUND, BUTTON_SOUND_X, g.getHeight() - Assets.BUTTON_HEIGHT, Assets.BUTTON_WIDTH, Assets.BUTTON_HEIGHT)); mBounds.append( 1, new Bounds( CLICK_PLAY, MENU_IMAGE_X, MENU_IMAGE_Y, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); mBounds.append( 2, new Bounds( CLICK_HIGHSCORES, MENU_IMAGE_X, MENU_IMAGE_Y + Assets.MENU_ITEM_HEIGHT, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); mBounds.append( 3, new Bounds( CLICK_SETTINGS, MENU_IMAGE_X, MENU_IMAGE_Y + 2 * Assets.MENU_ITEM_HEIGHT, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); mBounds.append( 4, new Bounds( CLICK_ACHIEVEMENTS, MENU_IMAGE_X, MENU_IMAGE_Y + 3 * Assets.MENU_ITEM_HEIGHT, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); mBounds.append( 5, new Bounds( CLICK_HELP, MENU_IMAGE_X, MENU_IMAGE_Y + 4 * Assets.MENU_ITEM_HEIGHT, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); mBounds.append( 6, new Bounds( CLICK_QUIT, MENU_IMAGE_X, MENU_IMAGE_Y + 5 * Assets.MENU_ITEM_HEIGHT, Assets.MENU_ITEM_WIDTH, Assets.MENU_ITEM_HEIGHT)); }