<commit_before>/*******************************************************************************
 * Copyright 2014 <NAME>.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.bladecoder.engine.ui;

import java.io.BufferedReader;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.bladecoder.engine.assets.EngineAssetManager;
import com.bladecoder.engine.ui.UI.Screens;
import com.bladecoder.engine.util.EngineLogger;
import com.bladecoder.engine.util.TextUtils;

public class CreditsScreen implements BladeScreen, InputProcessor {

	private final static String CREDITS_FILENAME = "ui/credits";
	private static final String FONT_TITLE_STYLE = "credits-title";
	private static final String FONT_STYLE = "credits";
	private static final float SPEED = 40; // px/sec.

	// title and texts pair sequence
	private List<String> credits = new ArrayList<String>();

	private BitmapFont creditsFont;
	private BitmapFont titlesFont;

	private int stringHead = 0;
	private float scrollY = 0; 

	private UI ui;

	private Music music;
	
	private final HashMap<String, Texture> images = new HashMap<String, Texture>();
	
	private Viewport viewport;

	public CreditsScreen() {
	}

	@Override
	public void render(float delta) {		
		SpriteBatch batch = ui.getBatch();
		int width = (int)viewport.getWorldWidth();
		int height = (int)viewport.getWorldHeight();
		
		Gdx.gl.glClearColor(0, 0, 0, 1);			
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

		batch.setProjectionMatrix(viewport.getCamera().combined);<commit_msg>set credits speed density dependent<commit_after>/*******************************************************************************
 * Copyright 2014 <NAME>.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.bladecoder.engine.ui;

import java.io.BufferedReader;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import com.bladecoder.engine.assets.EngineAssetManager;
import com.bladecoder.engine.ui.UI.Screens;
import com.bladecoder.engine.util.DPIUtils;
import com.bladecoder.engine.util.EngineLogger;
import com.bladecoder.engine.util.TextUtils;

public class CreditsScreen implements BladeScreen, InputProcessor {

	private final static String CREDITS_FILENAME = "ui/credits";
	private static final String FONT_TITLE_STYLE = "credits-title";
	private static final String FONT_STYLE = "credits";
	private static final float SPEED = 10 * DPIUtils.getSpacing(); // px/sec.

	// title and texts pair sequence
	private List<String> credits = new ArrayList<String>();

	private BitmapFont creditsFont;
	private BitmapFont titlesFont;

	private int stringHead = 0;
	private float scrollY = 0; 

	private UI ui;

	private Music music;
	
	private final HashMap<String, Texture> images = new HashMap<String, Texture>();
	
	private Viewport viewport;

	public CreditsScreen() {
	}

	@Override
	public void render(float delta) {		
		SpriteBatch batch = ui.getBatch();
		int width = (int)viewport.getWorldWidth();
		int height = (int)viewport.getWorldHeight();
		
		Gdx.gl.glClearColor(0, 0, 0, 1);			
		Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

		batch.setProjectionMatrix(viewport.getCamera().combined);
{'fraction_non_alphanumeric': 0.1491862567811935, 'fraction_numerical': 0.008318264014466547, 'mean_word_length': 5.145555555555555, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4247611', 'n_tokens_mistral': 1750, 'n_tokens_neox': 1615, 'n_words': 450}