Skip to content

Commit

Permalink
move alphabet font data to json
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed May 5, 2024
1 parent 477df16 commit 0e3501b
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 95 deletions.
356 changes: 356 additions & 0 deletions assets/preload/images/alphabet-font.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,356 @@
{
"letters": [
{
"lowerOffset": 5,
"boldOffset": -24,
"upperOffset": -18,
"id": "ã"
},
{
"id": "@"
},
{
"lowerOffset": 26,
"boldOffset": 2,
"upperOffset": 2,
"id": "ç"
},
{
"lowerOffset": -4,
"boldOffset": -31,
"upperOffset": -20,
"id": "é"
},
{
"boldOffset": -30,
"upperOffset": -19,
"id": "ê"
},
{
"lowerOffset": 5,
"boldOffset": -32,
"upperOffset": -19,
"id": "í"
},
{
"lowerOffset": 17,
"boldOffset": -18,
"upperOffset": -10,
"id": "ï"
},
{
"lowerOffset": 10,
"boldOffset": -22,
"upperOffset": -10,
"id": "ñ"
},
{
"lowerOffset": 2,
"boldOffset": -33,
"upperOffset": -22,
"id": "ó"
},
{
"lowerOffset": 5,
"boldOffset": -31,
"upperOffset": -18,
"id": "ô"
},
{
"lowerOffset": 9,
"boldOffset": -25,
"upperOffset": -15,
"id": "õ"
},
{
"lowerOffset": 1,
"boldOffset": -27,
"upperOffset": -15,
"id": "ú"
},
{
"lowerOffset": 11,
"boldOffset": -13,
"upperOffset": -4,
"id": "ü"
},
{
"id": "["
},
{
"id": "]"
},
{
"id": "^"
},
{
"id": "_"
},
{
"lowerOffset": 22,
"id": "a"
},
{
"boldOffset": -10,
"name": "exclamation",
"id": "!"
},
{
"lowerOffset": 8,
"boldOffset": -3,
"id": "b"
},
{
"lowerOffset": 25,
"boldOffset": 1,
"upperOffset": 1,
"id": "c"
},
{
"id": "#"
},
{
"lowerOffset": 5,
"upperOffset": 2,
"id": "d"
},
{
"id": "$"
},
{
"lowerOffset": 21,
"boldOffset": 1,
"upperOffset": 5,
"id": "e"
},
{
"id": "%"
},
{
"lowerOffset": 10,
"upperOffset": 6,
"id": "f"
},
{
"lowerOffset": 32,
"boldOffset": -3,
"upperOffset": 2,
"id": "g"
},
{
"name": "apostrophe",
"id": "'"
},
{
"lowerOffset": 12,
"upperOffset": 5,
"id": "h"
},
{
"id": "("
},
{
"lowerOffset": 15,
"boldOffset": 1,
"upperOffset": 6,
"id": "i"
},
{
"id": ")"
},
{
"lowerOffset": 15,
"boldOffset": -3,
"upperOffset": 4,
"id": "j"
},
{
"id": "*"
},
{
"lowerOffset": 10,
"boldOffset": -3,
"upperOffset": 6,
"id": "k"
},
{
"id": "+"
},
{
"lowerOffset": 10,
"upperOffset": 5,
"id": "l"
},
{
"lowerOffset": 40,
"name": "comma",
"id": ","
},
{
"lowerOffset": 31,
"boldOffset": 3,
"upperOffset": 8,
"id": "m"
},
{
"boldOffset": 25,
"id": "-"
},
{
"lowerOffset": 31,
"upperOffset": 8,
"id": "n"
},
{
"lowerOffset": 40,
"boldOffset": 50,
"name": "period",
"id": "."
},
{
"lowerOffset": 27,
"boldOffset": -3,
"upperOffset": 3,
"id": "o"
},
{
"lowerOffset": 3,
"id": "0"
},
{
"lowerOffset": 30,
"boldOffset": -3,
"upperOffset": 7,
"id": "p"
},
{
"lowerOffset": 4,
"id": "1"
},
{
"lowerOffset": 34,
"upperOffset": 6,
"id": "q"
},
{
"lowerOffset": 5,
"boldOffset": 2,
"id": "2"
},
{
"lowerOffset": 29,
"upperOffset": 3,
"id": "r"
},
{
"lowerOffset": 2,
"boldOffset": 1,
"id": "3"
},
{
"lowerOffset": 23,
"upperOffset": 3,
"id": "s"
},
{
"lowerOffset": 3,
"boldOffset": 2,
"id": "4"
},
{
"lowerOffset": 10,
"boldOffset": 1,
"upperOffset": 7,
"id": "t"
},
{
"lowerOffset": 4,
"id": "5"
},
{
"lowerOffset": 25,
"boldOffset": 7,
"upperOffset": 8,
"id": "u"
},
{
"lowerOffset": 26,
"upperOffset": 9,
"id": "v"
},
{
"lowerOffset": 4,
"id": "6"
},
{
"lowerOffset": 27,
"boldOffset": 3,
"upperOffset": 7,
"id": "w"
},
{
"lowerOffset": 8,
"boldOffset": 3,
"id": "7"
},
{
"lowerOffset": 25,
"upperOffset": 5,
"id": "x"
},
{
"lowerOffset": 1,
"id": "8"
},
{
"lowerOffset": 25,
"boldOffset": -3,
"upperOffset": 5,
"id": "y"
},
{
"lowerOffset": 1,
"id": "9"
},
{
"lowerOffset": 27,
"upperOffset": 10,
"id": "z"
},
{
"boldOffset": 10,
"id": ":"
},
{
"id": ";"
},
{
"id": "|"
},
{
"id": "<"
},
{
"id": "~"
},
{
"id": ">"
},
{
"lowerOffset": -5,
"boldOffset": -33,
"upperOffset": -24,
"id": "á"
},
{
"boldOffset": -27,
"upperOffset": -20,
"id": "â"
},
{
"boldOffset": -5,
"name": "question",
"id": "?"
}
]
}
11 changes: 2 additions & 9 deletions source/flixel/graphics/tile/FlxGraphicsShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FlxGraphicsShader extends GraphicsShader
if (hasColorTransform)
{
openfl_ColorOffsetv = colorOffset / 255.0;
openfl_ColorOffsetv = colorOffset * 0.00392;
openfl_ColorMultiplierv = colorMultiplier;
}
}")
Expand All @@ -43,14 +43,7 @@ class FlxGraphicsShader extends GraphicsShader
}
color = vec4(color.rgb / color.a, color.a);
mat4 colorMultiplier = mat4(0);
colorMultiplier[0][0] = openfl_ColorMultiplierv.x;
colorMultiplier[1][1] = openfl_ColorMultiplierv.y;
colorMultiplier[2][2] = openfl_ColorMultiplierv.z;
colorMultiplier[3][3] = openfl_ColorMultiplierv.w;
color = clamp(openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);
color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0);
return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);
}
")
Expand Down
Loading

0 comments on commit 0e3501b

Please sign in to comment.