Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Adding Landscape to Cascade
-
So I wanted to add a landscape mode to the cascade example, but using the scene.should_rotate didn't work.
I added:
def should_rotate(self, LANDSCAPE): columns = 20
But it unfortunately did not do anything. I tried searching for some help on this, as I was going to add it to more projects, but there isn't much out there.
Thank you.
-
What happens if you change the should_rotate() method to return True?
def should_rotate(self, orientation): columns = 20 return True
-
According to the <b>docs</b>, the function should <I> return True</I> if the scene should be rotated.
-
@ccc Tried this, still does not work.
@Sebastian I just want to allow support for landscape or portrait, depending on what the orientation the user started the program in.
-
Is the method getting called when you rotate the device?
def should_rotate(self, orientation): print('{}.should_rotate({})'.format(self, orientation)) columns = 20 return True
-
I just want to allow support for landscape or portrait, depending on what the orientation the user started the program in.
In that case, just remove the orientation parameter from the
run
call at the end of the script, i.e. change it torun(Game())
.Then, you can simply add the orientation logic (change number of columns etc.) in the
setup
method (ifself.size.w > self.size.h
, you're in landscape mode). -
@omz Thank you so much for responding. Truly great to get the app's developer to respond (not that I don't appreciate every one else's responses). If you could check out my other question, Help building a touch menu and help me figure that out it would be greatly appreciated.
-
This might sound stupid, but can't you just change portrait to landscape at the end of the code, then add a few columns and rows where the script is determining if your device is an iPad or iPhone? Or was that not the question at all?
-
@Qwerty2.17 that wasn't working, I had tried that.