Device orientation variable

A feature I’d like to see in Hopscotch is:

a device orientation variable that detects the device orientation (portrait or landscape)

I’d use it for this type of project:

designing a ui better if some things do not look as good in a different orientation

Here are some examples of Hopscotch code that could be improved if we had this:

look at the top right, the red text in the second image doesn’t look as good

Here is an example design I’ve made:

its a game variable, and you could select either portrait or landscape

I’ve seen something similar in another programming languages, it looks like this:

@media (orientation: portrait) {
  color: blue:
}

if I’m correct, the tilt right/left percentage blocks would not work as they reset if your orientation changes

Do you like the idea?
  • Yes, I’d like to see it implemented
  • No, this isn’t necessary
  • Maybe, I’m unsure about it

0 voters

12 Likes

no first post peoples

and please don’t say 2nd or 3rd or 4th or 5th post etc. either

4 Likes

I like this

4 Likes

I was actually thinking about this the other day! Great idea!

4 Likes

Nice idea!

4978th post is acceptable

4 Likes

indeed it is sir

2 Likes

Can’t you like just use the already built in variables?

3 Likes

Doesn’t this code do the same thing?

Check if iPad width > iPad height
(Orientation is landscape)
Else
(Orientation is portrait)

5 Likes

I knew I was forgetting something, that should work

3 Likes

That’s stage width/height, not device width/height

6 Likes

????

3 Likes

Yes this would be amazing
(Ya got a syntax error in the css hehe as waff said)

4 Likes

how did I not see that
I do that too many times on ipad

3 Likes

Wow yes this would be so helpful.

2 Likes

I like this but maybe… the game have to be like this


And then it is like this
image
And it isn’t complete

1 Like

It is really cool but maybe it have to be like this:


And then it is like this:

1 Like

A little confusing, but I think it’s cool?

1 Like

but with this block you could change what it looks like based on weather the device is in portrait or landscape


I can’t make it much simpler lol

3 Likes

I agree :slightly_smiling_face::+1:t2::stuck_out_tongue_winking_eye:

1 Like

lol

2 Likes