added the ability to premultiply the font file, removing fringing.

This commit is contained in:
Bryce Covert
2016-04-21 21:27:17 -07:00
parent 9fbda060fb
commit 7cc7e5fdf3
5 changed files with 6 additions and 5 deletions

View File

@@ -63,7 +63,7 @@
scale (/ scale 2)
scale (or (min (max scale 0.2) 0.25) 0.25)
tx (.getTexture tr)
_ (texture! tx :set-filter Texture$TextureFilter/Nearest Texture$TextureFilter/Nearest)
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)
style (style :label font color)
#_#__ (set! (.background style) bg)
[source-x source-y] [x y]
@@ -129,7 +129,7 @@
tx (.getTexture tr)
p (NinePatchEntity. (skin! (skin "ui/ui.json") :get-patch "ui-bg"))
_ (nine-patch! p :set-padding 25 25 5 15)
_ (texture! tx :set-filter Texture$TextureFilter/Nearest Texture$TextureFilter/Nearest)]
_ (texture! tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear)]
{:state {:object nil
:callback nil
:choices []

View File

@@ -64,8 +64,8 @@
(fn [screen entities]
(utils/setup-viewport screen 1280 960)
(let [highlighted-text (assoc (label "Hello" (style :label (utils/get-font "ego/font.fnt") (color :white))) :x 0 :y 850 :width 1280 )]
(label! highlighted-text :set-alignment Align/center)
(let [highlighted-text (assoc (label "Hello" (style :label (utils/get-font "ego/font.fnt") (color :white)) :set-font-scale 0.25) :x 0 :y 850 :width 1280 )]
(label! highlighted-text :set-alignment Align/bottom)
{:overlay (assoc (utils/get-texture "inventory-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :opacity 0.0)
:fade (assoc (utils/get-texture "black.png")
:scale-x 80