Camera for the storyboard can now do pan, bounce, dolly, and shake.
This commit is contained in:
parent
0d326089f7
commit
29409c54ce
5 changed files with 23 additions and 15 deletions
17
camera.cpp
17
camera.cpp
|
|
@ -40,15 +40,22 @@ namespace cinematic {
|
|||
anim = MGR.animations.at(name);
|
||||
}
|
||||
|
||||
void Camera::position(float x, float y) {
|
||||
anim.min_x = x;
|
||||
anim.min_y = y;
|
||||
void Camera::focus(float x, float y) {
|
||||
position.x = x;
|
||||
position.y = y;
|
||||
}
|
||||
|
||||
void Camera::move(sf::RenderTexture& target, sf::Vector2f pos) {
|
||||
sf::View zoom;
|
||||
anim.max_x = pos.x;
|
||||
anim.max_y = pos.y;
|
||||
|
||||
// BUG: annoying special case
|
||||
if(anim.motion == ease::SLIDE) {
|
||||
anim.min_x = position.x;
|
||||
anim.min_y = position.y;
|
||||
anim.max_x = pos.x;
|
||||
anim.max_y = pos.y;
|
||||
}
|
||||
|
||||
anim.apply(zoom, pos, size);
|
||||
target.setView(zoom);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue