diff options
| author | Michael Appell <[email protected]> | 2016-08-28 17:56:30 -0400 |
|---|---|---|
| committer | Michael Appell <[email protected]> | 2016-08-28 17:56:30 -0400 |
| commit | 4206c7d84977e40d092610fe35e2d937d693bd1c (patch) | |
| tree | 756096607a467f8dfbf88b596dd0e0147f2c9339 /tests | |
| parent | 858e025ba48d2b7a15d30aa20f820128ceb0d8f0 (diff) | |
| download | ruby2d-4206c7d84977e40d092610fe35e2d937d693bd1c.tar.gz ruby2d-4206c7d84977e40d092610fe35e2d937d693bd1c.zip | |
Made Text objects changeable dynamically
Modified text.rb so that the text= method modifies the instance variable
Modified ruby2d.c so that before rendering Text objects, it sets their value to whatever their @text variable is
Modified textcard.rb to demonstrate that Text objects can be dynamically changed
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/testcard.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/testcard.rb b/tests/testcard.rb index e96c217..c9204cc 100644 --- a/tests/testcard.rb +++ b/tests/testcard.rb @@ -135,9 +135,11 @@ Image.new(590, 400, "media/image.bmp") # Text Text.new(0, 250) # Default message -t = Text.new(0, 275, 30, "Hello Ruby 2D!", "media/bitstream_vera/vera.ttf") -t.color = 'red' # Doesn't work yet -fps = Text.new(0, 325, 20) +t1 = Text.new(0, 275, 30, "Hello Ruby 2D!", "media/bitstream_vera/vera.ttf") +t1.color = 'red' # Doesn't work yet +t2 = Text.new(0, 325, 20) # Default message +t2.text = "Text can be changed" +fps = Text.new(0, 375, 20) # Pointer for mouse pointer = Square.new(0, 0, 10, 'white') |
