Switch Orientations with a Button

Is it possible to switch orientations with a button press?

Everywhere I’ve searched only suggest events that listen to orientation changes… I’d like an event that changes the orientation. The default orientation change works perfectly; I’d just like it to switch orientations with a button press rather than by accelerometer. Specifically, from “portrait” to “portraitUpsideDown.”

Thank youuuuuuuuu (this would save a lot of dev time - I’d rather not program every single asset to flip). [import]uid: 191140 topic_id: 34711 reply_id: 334711[/import]

All you really need to do is rotate the parent display group of the elements you want to flip. [import]uid: 8271 topic_id: 34711 reply_id: 137906[/import]

Well, I’ll do that if there’s no other way, but there are several different groups that will need to be flipped. Obviously it’s not impossible, I just thought there’d be an easy way to tell the device to switch to a new orientation. It’s so easy in the build settings… :slight_smile: [import]uid: 191140 topic_id: 34711 reply_id: 137910[/import]

Why do you need to flip more than one group?

If what you want to do is make everything on the screen rotation to a different angle, just put all your current groups into one parent group and rotate that.

Essentially, that’s what the device would be doing anyway. [import]uid: 8271 topic_id: 34711 reply_id: 137914[/import]

Well, even if I do that, my drag functions are now backwards, and new objects being added to the screen are suddenly on the wrong side of the screen. It’s a huge headache that I was hoping to avoid. [import]uid: 191140 topic_id: 34711 reply_id: 137923[/import]

So, I’m working on just rotating the whole stage, which actually works fine, but I’ll still need to edit those drag functions a little bit. I wish there was an easier way, but, oh well. :slight_smile:

Thanks for the help. [import]uid: 191140 topic_id: 34711 reply_id: 137932[/import]

All you really need to do is rotate the parent display group of the elements you want to flip. [import]uid: 8271 topic_id: 34711 reply_id: 137906[/import]

Well, I’ll do that if there’s no other way, but there are several different groups that will need to be flipped. Obviously it’s not impossible, I just thought there’d be an easy way to tell the device to switch to a new orientation. It’s so easy in the build settings… :slight_smile: [import]uid: 191140 topic_id: 34711 reply_id: 137910[/import]

Why do you need to flip more than one group?

If what you want to do is make everything on the screen rotation to a different angle, just put all your current groups into one parent group and rotate that.

Essentially, that’s what the device would be doing anyway. [import]uid: 8271 topic_id: 34711 reply_id: 137914[/import]

Well, even if I do that, my drag functions are now backwards, and new objects being added to the screen are suddenly on the wrong side of the screen. It’s a huge headache that I was hoping to avoid. [import]uid: 191140 topic_id: 34711 reply_id: 137923[/import]

So, I’m working on just rotating the whole stage, which actually works fine, but I’ll still need to edit those drag functions a little bit. I wish there was an easier way, but, oh well. :slight_smile:

Thanks for the help. [import]uid: 191140 topic_id: 34711 reply_id: 137932[/import]