Added a #initialize_copy method to all classes which are wrapped around a C++ object in order to properly copy the values.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1740 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0920da5d8e
commit
bb7a6fac1f
14 changed files with 156 additions and 8 deletions
|
@ -76,6 +76,15 @@ static VALUE Text_Initialize( int argc, VALUE *args, VALUE self )
|
|||
return self;
|
||||
}
|
||||
|
||||
static VALUE Text_InitializeCopy( VALUE self, VALUE aSource )
|
||||
{
|
||||
sf::Text *object = NULL;
|
||||
Data_Get_Struct( self, sf::Text, object );
|
||||
sf::Text *source = NULL;
|
||||
Data_Get_Struct( aSource, sf::Text, source );
|
||||
*object = *source;
|
||||
}
|
||||
|
||||
/* call-seq:
|
||||
* text.setString( string )
|
||||
*
|
||||
|
@ -288,6 +297,7 @@ void Init_Text( void )
|
|||
|
||||
// Instance methods
|
||||
rb_define_method( globalTextClass, "initialize", Text_Initialize, -1 );
|
||||
rb_define_method( globalTextClass, "initialize_copy", Text_InitializeCopy, 1 );
|
||||
rb_define_method( globalTextClass, "setString", Text_SetString, 1 );
|
||||
rb_define_method( globalTextClass, "setFont", Text_SetFont, 1 );
|
||||
rb_define_method( globalTextClass, "setCharacterSize", Text_SetCharacterSize, 1 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue