kivent
kivent copied to clipboard
gameview scroll boundaries
After recent changes, it's possible to sroll out of map with focus_entity and entity_to_focus. Maybe related to #110
Steps to reproduce:
- clone https://bitbucket.org/maho/testcase-scrolllock
- run main.py RESULT: you can see that orange canvas ends after some time, when orange canves covers whole map.
SHOULD BE: you should see not even little strip of black background.
I have bisected it and bad change happend in commit 7b563ad2eec7567aced585ce83390fbccaf3b594
Or, there is misuse in my code.
I don't see anything glaringly wrong with your code, I'll take a more indepth look into this. We're currently engaged in a pretty expansive addition to the camera system with the google summer of code student @udiboy1209
focus_entity
is restricted by lock_scroll
here. Perhaps lock_scroll
isnt being used correctly with focus_entity
camera shifting.
I have debugged a bit, and I discovered that when I add following line to .kv ,
window_size: root.size
then it works ok.
But ... what the hell is window_size of GameView, and why it's initially set to 100, 100 ?
additionally - when I set window_size to root.size - it works in horizontal, but works bad in vertical, I see map partially outside the window and partially black area outsise of map.
window_size should be set to the size of the window, ensure that root.size is equivalent to this. Additionally, you might have to control the pos of the camera. Stencil or Scissor instructions can be used to clip beyond the bounds of the map as well. You may want to share an example application of what you are doing if there are still issues.
example is at https://bitbucket.org/maho/testcase-scrolllock/src (hg clone https://bitbucket.org/maho/testcase-scrolllock/ ),
I found fix for it (will create pull request in a minute)