kivent icon indicating copy to clipboard operation
kivent copied to clipboard

gameview scroll boundaries

Open maho opened this issue 8 years ago • 7 comments

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:

  1. clone https://bitbucket.org/maho/testcase-scrolllock
  2. 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.

maho avatar May 18 '16 20:05 maho

I have bisected it and bad change happend in commit 7b563ad2eec7567aced585ce83390fbccaf3b594

Or, there is misuse in my code.

maho avatar May 18 '16 21:05 maho

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

Kovak avatar May 18 '16 21:05 Kovak

focus_entity is restricted by lock_scroll here. Perhaps lock_scroll isnt being used correctly with focus_entity camera shifting.

udiboy1209 avatar May 18 '16 21:05 udiboy1209

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 ?

maho avatar May 23 '16 11:05 maho

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.

maho avatar Sep 29 '16 11:09 maho

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.

Kovak avatar Sep 29 '16 17:09 Kovak

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)

maho avatar Oct 01 '16 11:10 maho