diff options
| author | Amir Rajan <[email protected]> | 2020-08-01 11:47:35 -0500 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2020-08-01 11:47:35 -0500 |
| commit | e2703a351ef1dfa3f6ea72f9fd2814922729f0bb (patch) | |
| tree | e03c90b9e30aea3328b013e498387b6ec2b427f9 /samples | |
| parent | eb8b770e1952af371832f5f31e00dae09d498cf9 (diff) | |
| download | dragonruby-game-toolkit-contrib-e2703a351ef1dfa3f6ea72f9fd2814922729f0bb.tar.gz dragonruby-game-toolkit-contrib-e2703a351ef1dfa3f6ea72f9fd2814922729f0bb.zip | |
Updated LOWREZ sample app with a 4x4 font.
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/19_lowrez_jam/app/lowrez.rb | 7 | ||||
| -rw-r--r-- | samples/19_lowrez_jam/app/main.rb | 10 | ||||
| -rw-r--r-- | samples/19_lowrez_jam/fonts/lowrez.ttf | bin | 11248 -> 10224 bytes |
3 files changed, 10 insertions, 7 deletions
diff --git a/samples/19_lowrez_jam/app/lowrez.rb b/samples/19_lowrez_jam/app/lowrez.rb index 8b7dd28..1de5db1 100644 --- a/samples/19_lowrez_jam/app/lowrez.rb +++ b/samples/19_lowrez_jam/app/lowrez.rb @@ -19,6 +19,9 @@ LOWREZ_FONT_MD_HEIGHT = 10 LOWREZ_FONT_SM = -8.5 LOWREZ_FONT_SM_HEIGHT = 5 +LOWREZ_FONT_PATH = 'fonts/lowrez.ttf' + + class LowrezOutputs attr_accessor :width, :height @@ -65,7 +68,7 @@ class LowrezOutputs g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' + font: LOWREZ_FONT_PATH } end @@ -131,7 +134,7 @@ module GTK @args.render_target(:lowrez) .labels .each do |l| - l.text = l.text.downcase + # l.text = l.text.downcase l.y += 1 end diff --git a/samples/19_lowrez_jam/app/main.rb b/samples/19_lowrez_jam/app/main.rb index ff7311f..c0ff37c 100644 --- a/samples/19_lowrez_jam/app/main.rb +++ b/samples/19_lowrez_jam/app/main.rb @@ -103,7 +103,7 @@ def hello_world args g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' + font: LOWREZ_FONT_PATH } args.lowrez.sprites << { @@ -128,25 +128,25 @@ def how_to_render_a_label args args.lowrez.labels << { x: 0, y: 57, text: "hello world", size_enum: LOWREZ_FONT_XL, r: 0, g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' } + font: LOWREZ_FONT_PATH } # Render a LARGE/LG label (remove the "#" in front of each line below) args.lowrez.labels << { x: 0, y: 36, text: "hello world", size_enum: LOWREZ_FONT_LG, r: 0, g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' } + font: LOWREZ_FONT_PATH } # Render a MEDIUM/MD label (remove the "#" in front of each line below) args.lowrez.labels << { x: 0, y: 20, text: "hello world", size_enum: LOWREZ_FONT_MD, r: 0, g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' } + font: LOWREZ_FONT_PATH } # Render a SMALL/SM label (remove the "#" in front of each line below) args.lowrez.labels << { x: 0, y: 9, text: "hello world", size_enum: LOWREZ_FONT_SM, r: 0, g: 0, b: 0, a: 255, - font: 'fonts/lowrez.ttf' } + font: LOWREZ_FONT_PATH } # You are provided args.lowrez.default_label which returns a Hash that you # can ~merge~ properties with diff --git a/samples/19_lowrez_jam/fonts/lowrez.ttf b/samples/19_lowrez_jam/fonts/lowrez.ttf Binary files differindex 7085f45..2682cb0 100644 --- a/samples/19_lowrez_jam/fonts/lowrez.ttf +++ b/samples/19_lowrez_jam/fonts/lowrez.ttf |
