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 /ext | |
| 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 'ext')
| -rw-r--r-- | ext/ruby2d/ruby2d.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/ruby2d/ruby2d.c b/ext/ruby2d/ruby2d.c index 300198d..71b7225 100644 --- a/ext/ruby2d/ruby2d.c +++ b/ext/ruby2d/ruby2d.c @@ -243,6 +243,7 @@ static void render() { data->txt->x = NUM2DBL(rb_iv_get(el, "@x")); data->txt->y = NUM2DBL(rb_iv_get(el, "@y")); + S2D_SetText(data->txt, RSTRING_PTR(rb_iv_get(el, "@text"))); S2D_DrawText(data->txt); } break; |
