BBC BASIC
« Set orientation »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:41pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Set orientation  (Read 53 times)
roy
New Member
Image


member is offline

Avatar




PM


Posts: 44
xx Set orientation
« Thread started on: Mar 22nd, 2018, 03:44am »

Hi All

I wanted to try some sys calls so thought I'd try and set the orientation to Portrait.

Looked at this sit, and then came up with the listing below. Tried it a few different ways but can't get it to work.

Any ideas

Regards Roy


Code:
   10 on error if err=17 chain @lib$+"../examples/tools/touchide" else procCleanup : mode 3 : print report$; " At line " erl : wait 1000  : end
   20
   30 mode 6
      rem Set orientatton
   40 rem Values
   50 rem LandscapeLeft      = top of device left
   60 rem LandscapeRight     = top of device right
   70 rem Portrait           = top of device up
   80 rem PortraitUpsideDown = top of device down
   90
  100 LandscapeLeft = 0
  110 LandscapeRight = 1
  120 Portrait = 2
  130 PortraitUpsideDown = 3
  140
  150 sys "SDL_SetHint","SDL_HINT_ORIENTATIONS,Portrait"
  170 printtab(10,10)"Portrait"
  180 repeat wait 4 : until false


 



User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: Set orientation
« Reply #1 on: Mar 22nd, 2018, 11:16am »

on Mar 22nd, 2018, 03:44am, roy wrote:
I wanted to try some sys calls so thought I'd try and set the orientation to Portrait.

I'm not entirely clear what you are trying to achieve. If you want to lock the orientation so that device rotations have no effect (or to force it to portrait so that rotations are limited to +/- 180 degrees) that's something that must be set in the app's manifest, not in a BASIC program.

The Help instructions for BBC2APK explain how to create an APK with a custom manifest to force the orientation to portrait or landscape, but still under control of the accelerometer. You can also disable the automatic rotations altogether so that rotating the device by 180 degrees results in an upside-down display!

But that's got nothing to do with SYS or BASIC programming in general (SDL_HINT_ORIENTATIONS is explicitly documented as being for iOS, not Android).

Richard.
« Last Edit: Mar 22nd, 2018, 12:57pm by Richard Russell » User IP Logged

roy
New Member
Image


member is offline

Avatar




PM


Posts: 44
xx Re: Set orientation
« Reply #2 on: Mar 22nd, 2018, 7:45pm »

Hi Richard

Thanks for the explanation.

Regards Roy
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls