Results 1 to 4 of 4

Thread: Strange input coordinates on Android

  1. #1

    Default Strange input coordinates on Android

    Hi again.
    I wrote a simple app: stickman following user's touch. Everything works fine on windows, but on my Android device (allmighty Samsung i5700) touch coordinates from OnInput function are invalid.



    Screen-related functions in App::Init looks like this:
    Code:
    SetLockedLandscape(true); 
    SetManualRotationMode(false);
    SetupFakePrimaryScreenSize(320,480);
    Thanks in advance.

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Woah, nice job on doing an Android compile before I finished the wiki docs on that part, rzuf.

    I think you need to SetManualRotationMode(true), not false.

    Also, make sure in the manifest has android:screenOrientation="landscape" in it.

    If it's still wonky, try the RTSimpleApp example and see if the input works correctly. (It is landscape, scaling up the screen from 480X320 as well)

    PS: I'm soon going to update the examples with some improvements in the android build process, I finally figured out a way to get rid of the code duplication for the shared .java code and put them in the shared dir.

    Also added multi-touch and trackball support.
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,340

    Default

    Hmm, I went to test RTSimpleApp and noticed it was running in portrait on Android as well as the "Nexus One Landscape" windows screen setup. It was rotating when it didn't have to.

    I commited a fix to svn, here is the correct init code for RTSimpleApp, this may work better for you too:

    (keep in mind the SetupFakePrimaryScreenSize() stuff is only needed if you want to be able to assume the screen is 480X320 in your code, and have it stretch internally to whatever the device really is)

    Code:
    SetManualRotationMode(true);
    
    	
    	if (GetEmulatedPlatformID() == PLATFORM_ID_ANDROID)
    	{
    		//if we do this, everything will be stretched/zoomed to fit the screen
    		SetupFakePrimaryScreenSize(480,320); //game will think its this size, and will be scaled up
    		SetLockedLandscape(false); //because it's set in the app manifest, we don't have to rotate ourselves
    
    	} else
    	{
    		//if we do this, everything will be stretched/zoomed to fit the screen
    		SetLockedLandscape(true); //we don't allow portrait mode for this game
    		SetupFakePrimaryScreenSize(320,480); //game will think its this size, and will be scaled up
    	}
    Seth A. Robinson
    Robinson Technologies

  4. #4

    Default

    nice job on doing an Android compile before I finished the wiki docs on that part
    You left nice readme.txt file in android folder, so that wasn't really a problem. Copy and paste it into wiki and that will do.

    I commited a fix to svn, here is the correct init code for RTSimpleApp, this may work better for you too
    That helped! Thanks!

    PS: I'm soon going to update the examples with some improvements in the android build process, I finally figured out a way to get rid of the code duplication for the shared .java code and put them in the shared dir.

    Also added multi-touch and trackball support.
    Awesome, you are doing great work, thank you.

Similar Threads

  1. I'm getting strange error
    By Homer89 in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 05-28-2007, 07:11 PM
  2. Strange scrolling bug in OSX version:
    By whisperstorm in forum Novashell Game Creation System
    Replies: 3
    Last Post: 03-22-2007, 05:20 AM
  3. Strange Bury Points
    By aGig in forum Funeral Quest
    Replies: 3
    Last Post: 02-02-2007, 04:26 AM
  4. Strange problems
    By File Sponge in forum Funeral Quest
    Replies: 4
    Last Post: 08-29-2004, 07:16 AM
  5. Strange static sound
    By tamaralynn in forum Dink Smallwood HD
    Replies: 1
    Last Post: 11-22-2003, 02:32 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •