Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old January 18th, 2012, 06:00 AM   #1 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default game dev help (screen orientation)

hi

I am working on a game for android at the moment, and was wondering if anyone can tell me how i would change the screen depending on orientation

so if the user turned the phone horizontally then the app would be viewed horizontally if you know what i mean

also how would i make a timer, so if a button were pressed, how would i say stop for 2 seconds and then go to link?

thanks in advance
slick01

slick01 is offline  
Reply With Quote
Sponsors
Old January 23rd, 2012, 07:39 PM   #2 (permalink)
New Member
 
Join Date: Jan 2012
Posts: 2
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This would involve using the phones sensors to measure the position/orientation of the phone and change the camera accordingly. Possible using gluLookAt.
RadiatorRT is offline  
Reply With Quote
Old January 24th, 2012, 01:45 AM   #3 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
Default

Quote:
Originally Posted by slick01 View Post
I am working on a game for android at the moment, and was wondering if anyone can tell me how i would change the screen depending on orientation
Assuming your game UI is happening within an activity, check out Handling Runtime Changes | Android Developers.
jiminaus is offline  
Reply With Quote
Old January 24th, 2012, 01:47 AM   #4 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 308
 
Device(s): Samsung Galaxy Nexus
Thanks: 0
Thanked 52 Times in 51 Posts
Default

If you don't specify otherwise, android apps rotate depending on the sensors by default.
__________________
Android: Personal Storage, Lars Monsen Facts(Norwegian)
miXer is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:23 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo