SDLPP: Scene - add function to bring objet to the front or back of Z
This commit is contained in:
parent
1f5e3a999c
commit
5b96de0d9d
@ -59,6 +59,12 @@ void Scene::moveZ( const std::shared_ptr< RenderObject > &obj, int addition ) {
|
||||
std::iter_swap( render_objects.begin() + original_index,
|
||||
render_objects.begin() + original_index + addition );
|
||||
}
|
||||
void Scene::moveZTop( const std::shared_ptr< RenderObject > &obj ) {
|
||||
setZIndex( obj, render_objects.size() - 1 );
|
||||
}
|
||||
void Scene::moveZBottom( const std::shared_ptr< RenderObject > &obj ) {
|
||||
setZIndex( obj, 0 );
|
||||
}
|
||||
std::shared_ptr< RenderObject > Scene::getObject( int index ) {
|
||||
return render_objects[index];
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ public:
|
||||
void moveDownZ( const std::shared_ptr< RenderObject > &obj );
|
||||
void moveUpZ( const std::shared_ptr< RenderObject > &obj );
|
||||
void moveZ( const std::shared_ptr< RenderObject > &obj, int addition );
|
||||
void moveZTop( const std::shared_ptr< RenderObject > &obj );
|
||||
void moveZBottom( const std::shared_ptr< RenderObject > &obj );
|
||||
std::shared_ptr< RenderObject > getObject( int index );
|
||||
std::vector< std::shared_ptr< RenderObject > > getObjects();
|
||||
std::vector< std::shared_ptr< RenderObject > >
|
||||
|
Loading…
Reference in New Issue
Block a user