<commit_before>import flash.geom.Point;
import haxepunk.HXP;
import haxepunk.Entity;
import haxepunk.Scene;
import haxepunk.graphics.BitmapText;
import haxepunk.graphics.Image;

class MainScene extends Scene
{
	static var _time:Float = 0;
	static var _shakeChars:Map<String, Float> = new Map();
	static var _shake:Float = 0;

	static function shakeChar(char:String, point:Point):Point
	{
		if (!_shakeChars.exists(char) || _shake > 1)
		{
			_shakeChars[char] = Math.random() * 2 - 1;
		}
		point.y += _shakeChars[char];
		return point;
	}

	static function sineWave(char:String, point:Point):Point
	{
		point.y += (Math.sin(_time * 4 - point.x / 4) - 0.5) * 2;
		return point;
	}

	public function new()
	{
		super();

		BitmapText.defineFormatTag("blue", 0x5f8dd3);
		BitmapText.defineFormatTag("ghost", null, 0.5);
		BitmapText.defineFormatTag("big", null, null, 1.5);
		BitmapText.defineFormatTag("big_green", 0x55d400, null, 1.5);
		BitmapText.defineMoveTag("shake", shakeChar);
		BitmapText.defineMoveTag("sine", sineWave);
		var img = new Image("assets/graphics/star.png");
		img.scale = 0.25;
		img.smooth = true;
		BitmapText.defineImageTag("star", img);
		var img = new Image("assets/graphics/star.png");
		img.scale = 0.5;
		img.smooth = true;
		BitmapText.defineImageTag("big-star", img);

		var txt = new BitmapText("Here's some colored text.", 0, 0, 0, 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			color: 0xff0000,
		});
		addText(txt);

		var txt = new BitmapText("Char\nand line spacing", 0, 0, 0, 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
		});
		txt.charSpacing = txt.lineSpacing = 16;
		addText(txt);

		var txt = new BitmapText("This is some wrapped text. It will <sine>fill as much <shake>vertical</shake> space as needed</sine>, but width is limited, so it shouldn't extend past 75% of the screen width. This whole paragraph should wrap correctly. <sine><star/><star/><star/><star/><star/></sine>\nHard line breaks are also allowed.", 0, 0, Std.int(HXP.width * 0.75), 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			color: 0x00ff00,
			wordWrap: true
		});
		addText(txt);

		var txt = new BitmapText("This is <big>some</big> <blue><big>formatted</big> text.</blue> It should also <big_green>wrap</big_green> so it doesn't go past 75% of the screen width. <big>Big</big> and small text should start from the bottom of the line.", 0, 0, Std.int(HXP.width * 0.75), 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			wordWrap: true<commit_msg>Moving text.<commit_after>import flash.geom.Point;
import haxepunk.HXP;
import haxepunk.Entity;
import haxepunk.Scene;
import haxepunk.graphics.BitmapText;
import haxepunk.graphics.Image;

class MainScene extends Scene
{
	static var _time:Float = 0;
	static var _shakeChars:Map<String, Float> = new Map();
	static var _shake:Float = 0;

	static function shakeChar(char:String, point:Point):Point
	{
		if (!_shakeChars.exists(char) || _shake > 1)
		{
			_shakeChars[char] = Math.random() * 2 - 1;
		}
		point.y += _shakeChars[char];
		return point;
	}

	static function sineWave(char:String, point:Point):Point
	{
		point.y += (Math.sin(_time * 4 - point.x / 4) - 0.5) * 2;
		return point;
	}

	public function new()
	{
		super();

		BitmapText.defineFormatTag("white", 0xffffff);
		BitmapText.defineFormatTag("blue", 0x5f8dd3);
		BitmapText.defineFormatTag("ghost", null, 0.5);
		BitmapText.defineFormatTag("big", null, null, 1.5);
		BitmapText.defineFormatTag("big_green", 0x55d400, null, 1.5);
		BitmapText.defineMoveTag("shake", shakeChar);
		BitmapText.defineMoveTag("sine", sineWave);
		var img = new Image("assets/graphics/star.png");
		img.scale = 0.25;
		img.smooth = true;
		BitmapText.defineImageTag("star", img);
		var img = new Image("assets/graphics/star.png");
		img.scale = 0.5;
		img.smooth = true;
		BitmapText.defineImageTag("big-star", img);

		var txt = new BitmapText("Here's some colored text.", 0, 0, 0, 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			color: 0xff0000,
		});
		addText(txt);

		var txt = new BitmapText("Char\nand line spacing", 0, 0, 0, 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
		});
		txt.charSpacing = txt.lineSpacing = 16;
		addText(txt);

		var txt = new BitmapText("<white>This is some wrapped text.</white> It will <sine>fill as much vertical space as needed</sine>, <shake>but width is limited</shake>, so it shouldn't extend past 75% of the screen width. This whole paragraph should wrap correctly. <sine><star/><star/><star/><star/><star/></sine>\nHard line breaks are also allowed.", 0, 0, Std.int(HXP.width * 0.75), 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			color: 0x00ff00,
			wordWrap: true
		});
		addText(txt);

		var txt = new BitmapText("This is <big>some</big> <blue><big>formatted</big> text.</blue> It should also <big_green>wrap</big_green> so it doesn't go past 75% of the screen width. <big>Big</big> and small text should start from the bottom of the line.", 0, 0, Std.int(HXP.width * 0.75), 0, {
			font: "assets/fonts/azmoonfleet.64.fnt",
			size: 14,
			wordWrap: true
{'fraction_non_alphanumeric': 0.15422109573016182, 'fraction_numerical': 0.03255995320725288, 'mean_word_length': 4.114656031904287, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3279241', 'n_tokens_mistral': 2171, 'n_tokens_neox': 1847, 'n_words': 478}