Added clamp function
Refactoring
Added setTextureRect-method
Added onEvent and onUpdate-methods