From 7e42a2b505af83f5d76888d3421b78a81742308a Mon Sep 17 00:00:00 2001 From: groogy Date: Sun, 28 Nov 2010 01:02:57 +0000 Subject: [PATCH] Nothing major, just some changes here and there. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1722 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/sfml-graphics/graphics/Text.cpp | 4 +++- bindings/ruby/sfml-window/window/Window.cpp | 4 ++-- bindings/ruby/testing/render-window-demo.rb | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/sfml-graphics/graphics/Text.cpp b/bindings/ruby/sfml-graphics/graphics/Text.cpp index 089c3463..cc17188c 100644 --- a/bindings/ruby/sfml-graphics/graphics/Text.cpp +++ b/bindings/ruby/sfml-graphics/graphics/Text.cpp @@ -59,13 +59,15 @@ static VALUE Text_Initialize( int argc, VALUE *args, VALUE self ) { case 3: characterSize = FIX2UINT( args[2] ); + object->SetCharacterSize( characterSize ); case 2: VALIDATE_CLASS( args[1], globalFontClass, "font" ); Data_Get_Struct( args[1], sf::Font, font ); rb_iv_set( self, "@__font_ref", args[1] ); + object->SetFont( *font ); case 1: string = rb_string_value_cstr( &args[0] ); - *object = sf::Text( string, *font, characterSize ); + object->SetString( string ); case 0: break; default: diff --git a/bindings/ruby/sfml-window/window/Window.cpp b/bindings/ruby/sfml-window/window/Window.cpp index 2c812581..e70c8140 100644 --- a/bindings/ruby/sfml-window/window/Window.cpp +++ b/bindings/ruby/sfml-window/window/Window.cpp @@ -91,7 +91,7 @@ static VALUE Window_Create( int argc, VALUE *args, VALUE self ) VALIDATE_CLASS( args[1], rb_cString, "second" ); VALIDATE_CLASS( args[2], rb_cFixnum, "third" ); Data_Get_Struct( arg0, sf::VideoMode, mode ); - object->Create( *mode, rb_string_value_cstr( &args[1] ), FIX2UINT( args[2] ) ); + object->Create( *mode, rb_string_value_cstr( &args[1] ), FIX2INT( args[2] ) ); break; case 4: arg0 = VideoMode_ForceType( args[0] ); @@ -101,7 +101,7 @@ static VALUE Window_Create( int argc, VALUE *args, VALUE self ) VALIDATE_CLASS( args[3], globalContextSettingsClass, "fourth" ); Data_Get_Struct( arg0, sf::VideoMode, mode ); Data_Get_Struct( args[3], sf::ContextSettings, settings ); - object->Create( *mode, rb_string_value_cstr( &args[1] ), FIX2UINT( args[2] ), *settings ); + object->Create( *mode, rb_string_value_cstr( &args[1] ), FIX2INT( args[2] ), *settings ); break; default: rb_raise( rb_eArgError, "Expected 2..4 arguments but was given %d", argc ); diff --git a/bindings/ruby/testing/render-window-demo.rb b/bindings/ruby/testing/render-window-demo.rb index bbaf5a66..90d07c39 100644 --- a/bindings/ruby/testing/render-window-demo.rb +++ b/bindings/ruby/testing/render-window-demo.rb @@ -15,6 +15,7 @@ image.create( 100, 100, [255, 0, 0] ) sprite = SFML::Sprite.new( image, [500, 500] ) text = SFML::Text.new( "This is a test!" ) +text.position = [ 20, 20 ] while app.open? while event = app.get_event