Added source rectangle option for texture setting
This commit is contained in:
@@ -42,8 +42,16 @@ public:
|
||||
bool hasCollisions() const;
|
||||
const std::vector< std::shared_ptr< CollisionPolygon > > &
|
||||
getCollisions() const;
|
||||
virtual void setTexture( const std::shared_ptr< Texture > &t );
|
||||
virtual void setTexture( const std::string &img_path );
|
||||
virtual void setTexture( const std::shared_ptr< Texture > &t, int source_x,
|
||||
int source_y, int source_width,
|
||||
int source_height );
|
||||
virtual void setTexture( const std::shared_ptr< Texture > &t,
|
||||
SDL_Rect source_rect = { -1, -1, -1, -1 } );
|
||||
virtual void setTexture( const std::string &img_path, int source_x,
|
||||
int source_y, int source_width,
|
||||
int source_height );
|
||||
virtual void setTexture( const std::string &img_path,
|
||||
SDL_Rect source_rect = { -1, -1, -1, -1 } );
|
||||
virtual void setTexture( Font &font, const std::string &text,
|
||||
const std::string &color = "FFFFFF",
|
||||
const std::string &outline_color = "000000",
|
||||
@@ -81,6 +89,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void copyTo( std::shared_ptr< RenderObject > other );
|
||||
bool entireTexture();
|
||||
std::vector< std::shared_ptr< CollisionPolygon > > collisions;
|
||||
std::shared_ptr< Texture > texture;
|
||||
std::shared_ptr< Texture > cur_texture;
|
||||
@@ -98,6 +107,7 @@ protected:
|
||||
bool is_static = true;
|
||||
bool centerx = false;
|
||||
SDL_Rect rect;
|
||||
SDL_Rect src_rect = { -1, -1, -1, -1 };
|
||||
|
||||
private:
|
||||
void setSceneID( int id );
|
||||
|
||||
Reference in New Issue
Block a user