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
This commit is contained in:
groogy 2010-11-28 01:02:57 +00:00
parent 0446d03a03
commit 7e42a2b505
3 changed files with 6 additions and 3 deletions

View File

@ -59,13 +59,15 @@ static VALUE Text_Initialize( int argc, VALUE *args, VALUE self )
{ {
case 3: case 3:
characterSize = FIX2UINT( args[2] ); characterSize = FIX2UINT( args[2] );
object->SetCharacterSize( characterSize );
case 2: case 2:
VALIDATE_CLASS( args[1], globalFontClass, "font" ); VALIDATE_CLASS( args[1], globalFontClass, "font" );
Data_Get_Struct( args[1], sf::Font, font ); Data_Get_Struct( args[1], sf::Font, font );
rb_iv_set( self, "@__font_ref", args[1] ); rb_iv_set( self, "@__font_ref", args[1] );
object->SetFont( *font );
case 1: case 1:
string = rb_string_value_cstr( &args[0] ); string = rb_string_value_cstr( &args[0] );
*object = sf::Text( string, *font, characterSize ); object->SetString( string );
case 0: case 0:
break; break;
default: default:

View File

@ -91,7 +91,7 @@ static VALUE Window_Create( int argc, VALUE *args, VALUE self )
VALIDATE_CLASS( args[1], rb_cString, "second" ); VALIDATE_CLASS( args[1], rb_cString, "second" );
VALIDATE_CLASS( args[2], rb_cFixnum, "third" ); VALIDATE_CLASS( args[2], rb_cFixnum, "third" );
Data_Get_Struct( arg0, sf::VideoMode, mode ); 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; break;
case 4: case 4:
arg0 = VideoMode_ForceType( args[0] ); 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" ); VALIDATE_CLASS( args[3], globalContextSettingsClass, "fourth" );
Data_Get_Struct( arg0, sf::VideoMode, mode ); Data_Get_Struct( arg0, sf::VideoMode, mode );
Data_Get_Struct( args[3], sf::ContextSettings, settings ); 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; break;
default: default:
rb_raise( rb_eArgError, "Expected 2..4 arguments but was given %d", argc ); rb_raise( rb_eArgError, "Expected 2..4 arguments but was given %d", argc );

View File

@ -15,6 +15,7 @@ image.create( 100, 100, [255, 0, 0] )
sprite = SFML::Sprite.new( image, [500, 500] ) sprite = SFML::Sprite.new( image, [500, 500] )
text = SFML::Text.new( "This is a test!" ) text = SFML::Text.new( "This is a test!" )
text.position = [ 20, 20 ]
while app.open? while app.open?
while event = app.get_event while event = app.get_event