rubydraw 0.3.1.6 → 0.3.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rubydraw/text.rb +4 -4
- metadata +2 -2
data/lib/rubydraw/text.rb
CHANGED
@@ -3,11 +3,11 @@ module Rubydraw
|
|
3
3
|
# with the text to display. They can be drawn at a position on the
|
4
4
|
# screen.
|
5
5
|
class Text < Surface
|
6
|
-
attr_reader(:contents, :font, :color, :
|
6
|
+
attr_reader(:contents, :font, :color, :font_size)
|
7
7
|
|
8
8
|
# Create a new drawable Text object with the given font and contents.
|
9
|
-
def initialize(contents, color, font_name="Times New Roman",
|
10
|
-
@font, @contents, @
|
9
|
+
def initialize(contents, color, font_name="Times New Roman", font_size = 25)
|
10
|
+
@font, @contents, @font_size, @color = font_name, contents, font_size, color
|
11
11
|
if File.exist?(font_name)
|
12
12
|
font_path = font_name
|
13
13
|
else
|
@@ -18,7 +18,7 @@ module Rubydraw
|
|
18
18
|
unless File.exists?(font_path)
|
19
19
|
raise "Font file '#{font_name}' does not exist; attemped to load from '#{font_path}'"
|
20
20
|
end
|
21
|
-
sdl_text = SDL::TTF.OpenFont(font_path,
|
21
|
+
sdl_text = SDL::TTF.OpenFont(font_path, font_size)
|
22
22
|
raise(SDLError, "Failed to initialize font: #{SDL.GetError}") if sdl_text.pointer.null?
|
23
23
|
|
24
24
|
sdl_color = @color.to_sdl
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rubydraw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.3.1.
|
5
|
+
version: 0.3.1.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- J. Wostenberg
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-12-
|
13
|
+
date: 2011-12-23 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|