Search Results

Search found 935 results on 38 pages for 'landscape portrait'.

Page 10/38 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Moving while doing loop animation in RPGMaker

    - by AzDesign
    I made a custom class to display character portrait in RPGMaker XP Here is the class : class Poser attr_accessor :images def initialize @images = Sprite.new @images.bitmap = RPG::Cache.picture('Character.png') #100x300 @images.x = 540 #place it on the bottom right corner of the screen @images.y = 180 end end Create an event on the map to create an instance as global variable, tada! image popped out. Ok nice. But Im not satisfied, Now I want it to have bobbing-head animation-like (just like when we breathe, sometimes bob our head up and down) so I added another method : def move(x,y) @images.x += x @images.y += y end def animate(x,y,step,delay) forward = true 2.times { step.times { wait(delay) if forward move(x/step,y/step) else move(-x/step,-y/step) end } wait(delay*3) forward = false } end def wait(time) while time > 0 time -= 1 Graphics.update end end I called the method to run the animation and it works, so far so good, but the problem is, WHILE the portrait goes up and down, I cannot move my character until the animation is finished. So that's it, I'm stuck in the loop block, what I want is to watch the portrait moving up and down while I walk around village, talk to npc, etc. Anyone can solve my problem ? Or better solution ? Thanks in advance

    Read the article

  • how to make my code scalable on iphone ..thanks

    - by zjm1126
    this is my code: <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width,minimum-scale=0,maximum-scale=2.0><!--,user-scalable=no">--> </head> <body onorientationchange="updateOrientation();"> <div id="a"> <input id='ab' type="button" value="button" /> </div> <div id=b style="display: none"></div> <style type="text/css"> *{ margin:0; padding:0; } body{ /*height: 356px;* } /* Reposition on orientation change */ body.landscape{ height: 208px; } body.landscape div#a{ line-height:104px; } div#a{ height:50%; line-height:178px; text-align:center; } #b{ width:100%; height:50%; background:red; } </style> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript"> function updateOrientation() { var orientation = window.orientation; switch (orientation) { // If we're horizontal case 90: case -90: // Set orient to landscape $(document.body).addClass("landscape"); break; // If we're vertical default: // Set orient to portrait $(document.body).removeClass("landscape"); break; } } $('#ab').click(function(){ if($('#b').css('display')=='none')$('#b').css('display','block') else $('#b').css('display','none') }) </script> </body> </html> thanks

    Read the article

  • proper fill an image larger than screen

    - by madcat
    what I wanted to achieve here is simply fit the image width to the screen on both orientations and use UIScrollView to just allow scroll vertically to see the whole image. both viewController and view are created pragmatically. the image loaded is larger than screen on both width and height. here is the related code in my viewController: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } - (void)loadView { UIScreen *screen = [UIScreen mainScreen]; CGRect rect = [screen applicationFrame]; self.view = [[UIView alloc] initWithFrame:rect]; self.view.contentMode = UIViewContentModeScaleAspectFill; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; UIImage *img=[[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]]; UIImageView *imgView =[[UIImageView alloc] initWithImage:img]; [img release]; imgView.contentMode = UIViewContentModeScaleAspectFill; imgView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view addSubview:imgView]; [imgView release]; } tried all combinations for both contentMode above, did not give me correct result. the most close I am getting now: I manually resize imgView in loadView, portrait mode would display correctly since app always starts with portrait mode, but in landscape mode, the width fits correctly, but image is centered vertically rather than top aligned. if I add the imgView to a scrollView, in landscape mode it looks like contentSize is not set to full image size. but when I scroll bounce I can see the image is there in full size. question: why I need to resize it manually? in landscape mode how and where I can 'move' the imgView, so imgView.frame.origin is (0,0) and works correctly with a scroll view? Thanks! UPDATE: I added: imgView.clipsToBounds = YES; and find out in landscape mode the image bounds is smaller than screen in height. so the question becomes how to have the image view keeps original ratio (thus shows the full image always) when rotated to landscape? do I need to manually resize it after rotation again?

    Read the article

  • OpenGL ES, UIView and Status Bar mess

    - by sfider
    I have iPhone (iPhoneOS 3.x) OpenGL ES app that: can be in landscape/portrait orientation can be with/without status bar shown I do this by changing status bar orientation and hidden state, then updating OpenGL view frame so it won't overlap status bar and setting projection matrix appropriately. OpenGL view is in portrait orientation at all time. View controller's shouldAutorotateToInterfaceOrientation: method returns false always, so the status bar won't start autorotating when app is in landscape mode. The problem I have is that I want to use some other UIViews, like: UIWebView, MFMailComposeView, MPMediaPicker. I could show them as modals, but this this have some drawbacks: views will always show in portrait orientation, even if they support landscape orientation views will not autorotate, even if they support it What I do is I take OpenGL view of the window with removeFromSuperview, set transform to the other view so it will be in portrait/landscape orientation when it shows up and place the other view on the window with addSubview:. This works fine without the status bar, but with it there are some problems I cannot work out: MPMediaPicker is sized to fit under status bar, but it slides under it anyway MFMailComposeView does not show navigation bar until it autorotates on device orientation change Does anyone has an idea how can I get it to work?

    Read the article

  • How to get NEW width/height of root layout in onConfigurationChanged?

    - by jboxer
    One of our views has a ScrollView as its root layout. When the device is rotated and onConfigurationChanged() is called, we'd like to be able to get the ScrollView's new width/height. Our code looks like this: @Override public void onConfigurationChanged(Configuration newConfig) { Log.d(TAG, "Width: '" + findViewById(R.id.scrollview).getWidth() + "'"); Log.d(TAG, "Height: '" + findViewById(R.id.scrollview).getHeight() + "'"); super.onConfigurationChanged(newConfig); Log.d(TAG, "Width: '" + findViewById(R.id.scrollview).getWidth() + "'"); Log.d(TAG, "Height: '" + findViewById(R.id.scrollview).getHeight() + "'"); } And the relevant section of our AndroidManifest.xml looks like this: <activity android:name=".SomeActivity" android:configChanges="keyboardHidden|orientation"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> On our Droid, we expected to see the ScrollView's width go to 854 when switched into landscape, and to 480 when switched back to portrait (and the height do the equivalent switch, minus the menu bar). However, we're seeing the opposite. Here's our LogCat: // Switching to landscape: 03-26 11:26:16.490: DEBUG/ourtag(17245): Width: '480' // Before super 03-26 11:26:16.490: DEBUG/ourtag(17245): Height: '778' // Before super 03-26 11:26:16.529: DEBUG/ourtag(17245): Width: '480' // After super 03-26 11:26:16.536: DEBUG/ourtag(17245): Height: '778' // After super // Switching to portrait: 03-26 11:26:28.724: DEBUG/ourtag(17245): Width: '854' // Before super 03-26 11:26:28.740: DEBUG/ourtag(17245): Height: '404' // Before super 03-26 11:26:28.740: DEBUG/ourtag(17245): Width: '854' // After super 03-26 11:26:28.740: DEBUG/ourtag(17245): Height: '404' // After super Clearly, we're getting the portrait dimensions when we switch to landscape, and the landscape dimensions when we switch to portrait. Is there something we're doing wrong? We could get hacky and solve this, but I feel like there's a simple solution that we're missing.

    Read the article

  • How to handle activity life cycle involving sockets in Android?

    - by Henrik
    Hello all, I have an Android activity which in turn starts a thread. In the thread I open a persistent TCP socket connection. When the socket connects to the server dynamic data is downloaded. The thread sends messages using Handler-class to the activity when data has been received. Now if the user happens to switch from portrait to landscape mode the activity gets an onDestroy call. At this moment I close the socket and stop the thread. When Android has switched landscape mode it calls onCreate yet again and I have to do a socket re-connect. Also, all of the data the activity received needs to be downloaded once more because the server does not have the ability to know what has been sent before, i.e. there is no "resume" feature. Thus the problem is that there is alot of data which is resent all the time when landscape mode is changed. What are my options here? Should I create a service which handles the socket traffic towards the server thus I always got all the data which the server has sent in the service. Or should I disable landscape mode all together perhaps? Or would my best bet be to rewrite my server which is a VERY BIG job :-) All input is welcome :-) / Henrik

    Read the article

  • Gracefully handling screen orientation change during activity start

    - by Steve H
    I'm trying to find a way to properly handle setting up an activity where its orientation is determined from data in the intent that launched it. This is for a game where the user can choose levels, some of which are int portrait orientation and some are landscape orientation. The problem I'm facing is that setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) doesn't take effect until the activity is fully loaded. This is a problem for me because I do some loading and image processing during startup, which I'd like to only have to do once. Currently, if the user chose a landscape level: the activity starts onCreate(), defaulting to portrait discovers from analysing its launching Intent that it should be in landscape orientation continues regardless all the way to onResume(), loading information and performing other setup tasks at this point setRequestedOrientation kicks in so the application runs through onPause() to onDestroy() it then again starts up from onCreate() and runs to onResume() repeating the setup from earlier Is there a way to avoid that and have it not perform the loading twice? For example, ideally, the activity would know before even onCreate was called whether it should be landscape or portrait depending on some property of the launching intent, but unless I've missed something that isn't possible. I've managed to hack together a way to avoid repeating the loading by checking a boolean before the time-consuming loading steps, but that doesn't seem like the right way of doing it. I imagine I could override onSaveInstanceState, but that would require a lot of additional coding. Is there a simple way to do this? Thanks!

    Read the article

  • Auto-rotating freshly created interface

    - by zoul
    Hello! I have trouble with auto-rotating interfaces in my iPad app. I have a class called Switcher that observes the interface rotation notifications and when it receives one, it switches the view in window, a bit like this: - (void) orientationChanged: (NSNotification*) notice { UIDeviceOrientation newIO = [[UIDevice currentDevice] orientation]; UIViewController *newCtrl = /* something based on newIO */; [currentController.view removeFromSuperview]; // remove the old view [window addSubview newCtrl.view]; [self setCurrentController:newCtrl]; } The problem is that the new view does not auto-rotate. My auto-rotation callback in the controller class looks like this: - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) io { NSString *modes[] = {@"unknown", @"portrait", @"portrait down", @"landscape left", @"landscape right"}; NSLog(@"shouldAutorotateToInterfaceOrientation: %i (%@)", io, modes[io]); return YES; } But no matter how I rotate the device, I find the following in the log: shouldAutorotateToInterfaceOrientation: 1 (portrait) shouldAutorotateToInterfaceOrientation: 1 (portrait) …and the willRotateToInterfaceOrientation:duration: does not get called at all. Now what? The orientation changing is becoming my least favourite part of the iPhone SDK… (I can’t check the code on the device yet, could it be a bug in the simulator?) PS. The subscription code looks like this: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];

    Read the article

  • Tips for XNA WP7 Developers

    - by Michael B. McLaughlin
    There are several things any XNA developer should know/consider when coming to the Windows Phone 7 platform. This post assumes you are familiar with the XNA Framework and with the changes between XNA 3.1 and XNA 4.0. It’s not exhaustive; it’s simply a list of things I’ve gathered over time. I may come back and add to it over time, and I’m happy to add anything anyone else has experienced or learned as well. Display · The screen is either 800x480 or 480x800. · But you aren’t required to use only those resolutions. · The hardware scaler on the phone will scale up from 240x240. · One dimension will be capped at 800 and the other at 480; which depends on your code, but you cannot have, e.g., an 800x600 back buffer – that will be created as 800x480. · The hardware scaler will not normally change aspect ratio, though, so no unintended stretching. · Any dimension (width, height, or both) below 240 will be adjusted to 240 (without any aspect ratio adjustment such that, e.g. 200x240 will be treated as 240x240). · Dimensions below 240 will be honored in terms of calculating whether to use portrait or landscape. · If dimensions are exactly equal or if height is greater than width then game will be in portrait. · If width is greater than height, the game will be in landscape. · Landscape games will automatically flip if the user turns the phone 180°; no code required. · Default landscape is top = left. In other words a user holding a phone who starts a landscape game will see the first image presented so that the “top” of the screen is along the right edge of his/her phone, such that the natural behavior would be to turn the phone 90° so that the top of the phone will be held in the user’s left hand and the bottom would be held in the user’s right hand. · The status bar (where the clock, battery power, etc., are found) is hidden when the Game-derived class sets GraphicsDeviceManager.IsFullScreen = true. It is shown when IsFullScreen = false. The default value is false (i.e. the status bar is shown). · You should have a good reason for hiding the status bar. Users find it helpful to know what time it is, how much charge their battery has left, and whether or not their phone is in service range. This is especially true for casual games that you expect someone to play for a few minutes at a time, e.g. while waiting for some event to start, for a phone call to come in, or for a train, bus, or subway to arrive. · In portrait mode, the status bar occupies 32 pixels of space. This means that a game with a back buffer of 480x800 will be scaled down to occupy approximately 461x768 screen pixels. Setting the back buffer to 480x768 (or some resolution with the same 0.625 aspect ratio) will avoid this scaling. · In landscape mode, the status bar occupies 72 pixels of space. This means that a game with a back buffer of 800x480 will be scaled down to occupy approximately 728x437 screen pixels. Setting the back buffer to 728x480 (or some resolution with the same 1.51666667 aspect ratio) will avoid this scaling. Input · Touch input is scaled with screen size. · So if your back buffer is 600x360, a tap in the bottom right corner will come in as (599,359). You don’t need to do anything special to get this automatic scaling of touch behavior. · If you do not use full area of the screen, any touch input outside the area you use will still register as a touch input. For example, if you set a portrait resolution of 240x240, it would be scaled up to occupy a 480x480 area, centered in the screen. If you touch anywhere above this area, you will get a touch input of (X,0) where X is a number from 0 to 239 (in accordance with your 240 pixel wide back buffer). Any touch below this area will give a touch input of (X,239). · If you keep the status bar visible, touches within its area will not be passed to your game. · In general, a screen measurement is the diagonal. So a 3.5” screen is 3.5” long from the bottom right corner to the top left corner. With an aspect ratio of 0.6 (480/800 = 0.6), this means that a phone with a 3.5” screen is only approximately 1.8” wide by 3” tall. So there are approximately 267 pixels in an inch on a 3.5” screen. · Again, this time in metric! 3.5 inches is approximately 8.89 cm. So an 8.89 cm screen is 8.89 cm long from the bottom right corner to the top left corner. With an aspect ratio of 0.6, this means that a phone with an 8.89 cm screen is only approximately 4.57 cm wide by 7.62 cm tall. So there are approximately 105 pixels in a centimeter on an 8.89 cm screen. · Think about the size of your finger tip. If you do not have large hands, think about the size of the fingertip of someone with large hands. Consider that when you are sizing your touch input. Especially consider that when you are spacing two touch targets near one another. You need to judge it for yourself, but items that are next to each other and are each 100x100 should be fine when it comes to selecting items individually. Smaller targets than that are ok provided that you leave space between them. · You want your users to have a pleasant experience. Making touch controls too small or too close to one another will make them nervous about whether they will touch the right target. Take this into account when you plan out your game initially. If possible, do some quick size mockups on an actual phone using colored rectangles that you position and size where you plan to have your game controls. Adjust as necessary. · People do not have transparent hands! Nor are their hands the size of a mouse pointer icon. Consider leaving a dedicated space for input rather than forcing the user to cover up to one-third of the screen with a finger just to play the game. · Another benefit of designing your controls to use a dedicated area is that you’re less likely to have players moving their finger(s) so frantically that they accidentally hit the back button, start button, or search button (many phones have one or more of these on the screen itself – it’s easy to hit one by accident and really annoying if you hit, e.g., the search button and then quickly tap back only to find out that the game didn’t save your progress such that you just wasted all the time you spent playing). · People do not like doing somersaults in order to move something forward with accelerometer-based controls. Test your accelerometer-based controls extensively and get a lot of feedback. Very well-known games from noted publishers have created really bad accelerometer controls and been virtually unplayable as a result. Also be wary of exceptions and other possible failures that the documentation warns about. · When done properly, the accelerometer can add a nice touch to your game (see, e.g. ilomilo where the accelerometer was used to move the background; it added a nice touch without frustrating the user; I also think CarniVale does direct accelerometer controls very well). However, if done poorly, it will make your game an abomination unto the Marketplace. Days, weeks, perhaps even months of development time that you will never get back. I won’t name names; you can search the marketplace for games with terrible reviews and you’ll find them. Graphics · The maximum frame rate is 30 frames per second. This was set as a compromise between battery life and quality. · At least one model of phone is known to have a screen refresh rate that is between 59 and 60 hertz. Because of this, using a fixed time step with a target frame rate of 30 will cause a slight internal delay to build up as the framework is forced to wait slightly for the next refresh. Eventually the delay will get to the point where a draw is skipped in order to recover from the delay. (See Nick's comment below for clarification.) · To deal with that delay, you can either stay with a fixed time step and set the frame rate slightly lower or else you can go to a variable time step and make sure to adjust all of your update data (e.g. player movement distance) to take into account the elapsed time from the last update. A variable time step makes your update logic slightly more complicated but will avoid frame skips entirely. · Currently there are no custom shaders. This might change in the future (there is no hardware limitation preventing it; it simply wasn’t a feature that could be implemented in the time available before launch). · There are five built-in shaders. You can create a lot of nice effects with the built-in shaders. · There is more power on the CPU than there is on the GPU so things you might typically off-load to the GPU will instead make sense to do on the CPU side. · This is a phone. It is not a PC. It is not an Xbox 360. The emulator runs on a PC and uses the full power of your PC. It is very good for testing your code for bugs and doing early prototyping and layout. You should not use it to measure performance. Use actual phone hardware instead. · There are many phone models, each of which has slightly different performance levels for I/O, screen blitting, CPU performance, etc. Do not take your game right to the performance limit on your phone since for some other phones you might be crossing their limits and leaving players with a bad experience. Leave a cushion to account for hardware differences. · Smaller screened phones will have slightly more dots per inch (dpi). Larger screened phones will have slightly less. Either way, the dpi will be much higher than the typical 96 found on most computer screens. Make sure that whoever is doing art for your game takes this into account. · Screens are only required to have 16 bit color (65,536 colors). This is common among smart phones. Using gradients on a 16 bit display can produce an ugly artifact known as banding. Banding is when, rather than a smooth transition from one color to another, you instead see distinct lines. Be careful to avoid this when possible. Banding can be avoided through careful art creation. Its effects can be minimized and even unnoticeable when the texture in question is always moving. You should be careful not to rely on “looks good on my phone” since some phones do have 32-bit displays and thus you’ll find yourself wondering why you’re getting bad reviews that complain about the graphics. Avoid gradients; if you can’t, make sure they are 16-bit safe. Audio · Never rely on sounds as your sole signal to the player that something is happening in the game. They might have the sound off. They might be playing somewhere loud. Etc. · You have to provide controls to disable sound & music. These should be separate. · On at least one model of phone, the volume control API currently has no effect. Players can adjust sound with their hardware volume buttons, but in game selectors simply won’t work. As such, it may not be worth the effort of providing anything beyond on/off switches for sound and music. · MediaPlayer.GameHasControl will return true when a game is hooked up to a PC running Zune. When Zune is running, any attempts to do anything (beyond check GameHasControl) with MediaPlayer will cause an exception to be thrown. If this exception is thrown, catch it and disable music. Exceptions take time to propagate; you don’t want one popping up in every single run of your game’s Update method. · Remember that players can already be listening to music or using the FM radio. In this case GameHasControl will be false and you should handle this appropriately. You can, alternately, ask the player for permission to stop their current music and play your music instead, but the (current) requirement that you restore their music when done is very hard (if not impossible) to deal with. · You can still play sound effects even when the game doesn’t have control of the music, but don’t think this is a backdoor to playing music. Your game will fail certification if your “sound effect” seems to be more like music in scope and length.

    Read the article

  • How to record an iPad screencast

    - by hgpc
    How do you record an iPad screencast at full scale? I have an iMac with maximum resolution 1680x1050 and the simulator doesn't fit the screen in portrait orientation. It does fit in landscape orientation. Reducing the scale to 50% is not an option because the end result is too small. If the scale could be reduced slightly it would be fine, but not 50%. Is it possible to put the simulator in landscape orientation and still keep the app in portrait mode? Then I could simply rotate the resulting video to get a portrait screencast.

    Read the article

  • iPhone Orientation Relayout From Single Column to Double Column

    - by kkrizka
    I am trying to create a UIView in Interface Builder that shows to the user two boxes containing some text. This UIView should support both landscape and portrait modes. When in portrait orientation, the two boxes should be centered horizontally and be under each other. Like in the picture below: But when in landscape orientation, it should show the two boxes centered vertically and by side by side. Like in the picture below: Is this possible using only the autosizing options (or any other IB options), or do I have to relayout the view in code on orientation change events? I would prefer using only IB. I tried locking the top and left margins of the top box and locking the bottom and right margins of the bottom box. But the problem is that for it to work I also need to shrink the two boxes as one changes from portrait to landscape, because otherwise they would overlap.

    Read the article

  • iPad SDK, how to handle orientation with an UIImageView

    - by Salah
    Hello I'm developing an app for iPad and I try to handle multiple orientation. My app contains a webview and a loading UIImageView that appears when my webview is loading content. This UIImageView has a background image that I set in InterfaceBuilder. When I change orientation to landscape, the image is cut. I'd like the UIImageView to set image-portrait.png when the ipad is in portrait mode and image-landscape.png when it's in landscape mode. Thank you for your help and advices! Screenshots :

    Read the article

  • Very Intermittent Orientation on Device & Simulator

    - by Michael Waterfall
    I've noticed that I'm getting very intermittent orientation on my device & the simulator. I have a modal view controller that I present, and that is the only thing in my app which supports rotation. If I launch the app in portrait without moving the device, open the modal VC and then rotate the device, it usually works. However sometimes if I open the app holding the device in landscape, then rotate to portrait, launch the VC and then rotate the device, no rotation occurs. It seems very intermittent. Sometimes if I launch the app in portrait mode and then open the VC and rotate the device, nothing happens, and until I quit and relaunch it no orientation occurs in the app. It's strange because 50% of the time it works! Whenever I launch it through Xcode and set breakpoints in shouldAutorotateToInterfaceOrientation it always works! Anyone ever had this or know what's going on?

    Read the article

  • How to load different XIBs for different device orientations for same viewcontroller?

    - by Jaanus
    The documentation says that if I want to support both portrait and landscape, I basically have two ways of doing that: Set up the viewcontroller's view so that the subviews autoresize correctly and make smaller changes programmatically at runtime If the changes are more substantial, create an alternative landscape interface and push/pop the alternative modal viewcontroller at runtime I would like to present the info where the layout is substantially different, but logic is the same. Ideally, I would load another XIB for the same viewcontroller, but it does not seem to be an option. Sounds like #2 is what I need to do, but my problem with that is that it sounds like it would use the standard modalviewcontroller animations that are nothing like the device rotation animation. (Of course, being the lazywebber that I am, I did not test this hypothesis.) So, how do I load an alternative layout for landscape with the same viewcontroller but different XIB? Should I use the method #2 above and is the rotation animation natural? Or is there some other way?

    Read the article

  • how to change orientation of the iphone /ipod ?

    - by Balraj
    HI All i am using the device orientation for some functionality like as in stating the as we run the app it should be in the landscape mode and in this mode if we orientate the phone in 90 angle than it should play some video than problem comes video play by default in the landscape mode but we need it in the portrait mode than for playing video in the portrait mode we put the code [ mPlayer setOrientation:UIDeviceOrientationPortrait animated:NO]; like this even this method show a warning but it do work for playing the video in the portrait mode. now what is the problem :-as we start the app the screen we were showing in the starting of the app just comes and disaapper and it just starts playing the video and not come to that screen we even use the default rotation function to make it usable but it doesn't work any suggestion thanks Balraj Verma

    Read the article

  • How to rotate a UIImageView?

    - by jkally
    It's quite frustrating not to be able to do such a simple task: I have an "app" with a single viewcontroller, and in it a single UIImageView, that's initialized to a specific image at potrtait mode. Now when the iPhone gets roteated to landscape mode and the shouldAutorotateToInterfaceOrientation event fires, at which I return YES, my resulting UIImageView looks totally screwed up: either the image is stretched so to fill landscape mode frame (which looks ridiculuous of course) or the top and bottom of the image are cropped. How can I have my UIImageview and the contained image handle the device rotation gracefully, and display normal looking image at landscape mode as well?

    Read the article

  • Actionbar scherlock is not refreshed when the orientation is changed

    - by SavasCinar
    I use Sherlock action bar in my application. I used "ifRoom|withText" feature in my menu. If I test my code in portrait mode, I can see only icon and if I rotate orientation to landscape, still I see only icon. On the other hand, if I run with landscape, I can see text and icon on portrait and landscape. This means that When the screen is rotated, action bar is not refreshed. How can I fix? In menu, I have android:showAsAction="ifRoom|withText" Also I used this line in my manifest file to fixed android:configChanges="keyboardHidden|orientation|screenSize" but it didn't work. And I run my code android 2.3 Also I used fragment in my activity, FragmentManager fm = getSupportFragmentManager(); ft = fm.beginTransaction(); mFragment1 = fm.findFragmentByTag("f1"); if (mFragment1 == null) { mFragment1 = new MenuFragment(); ft.add(mFragment1, "f1"); } ft.commit();

    Read the article

  • camera captured image default rotating with 90 degree angle.

    - by kamiomar
    Dear, currently i am using android Api 4. my camera initializing code is follow: public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // Now that the size is known, set up the camera parameters and begin // the preview. Parameters parameters = camera.getParameters(); parameters.set("jpeg-quality", 100); parameters.set("orientation", "portrait"); parameters.set("picture-size", "320X430"); parameters.set("rotation", 0); parameters.setPictureFormat(PixelFormat.JPEG); camera.setParameters(parameters); camera.startPreview(); } i set the orientation portrait, camera preview working appropriately. but when i captured the image ,its rotating the image with 90 degree.In the landscape orientation its working perfectly. so how i can capture normal image using portrait orientation. thanks.

    Read the article

  • The xml is not switching when device orientation change

    - by Labeeb P
    Hi, I have made two folders, res/layout and res/layout-land The output i got If I start the application in portrait mode, it will always use the xml in layout folder if the application run in portrait mode. And will not use xml in layout-land if i change the device to landscape mode If it start in landscape mode it only use the xml in layout-land The xml is not switching when the orientation change What i expect was It should use the xml in layout folder while it is in portrait mode and use the xml in layout-land while in landscape mode In the Manifest file i have added android:configChanges="orientation" for the activity and <supports-screens android:resizeable="true" android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" /> Did i missed any thing here? What changes i need to do here? Thank You

    Read the article

  • How to do orientation rotation like built-in Calc app?

    - by Ray Wenderlich
    I'm trying to make an app that handles orientation/rotation similarly to the way the built-in Calc app does. If you check out that app, in portrait mode there's a normal calculator, and if you rotate to landscape mode there are additional buttons that appear to the left. I can't figure out how to do this by setting the autosize masks. The problem is the "normal" calculator view is 320px wide in portrait mode, but actually shrinks to around 240px in landscape mode to fit the additional controls. I've seen examples like the AlternateViews sample app that have two different view controllers (one for portrait and one for landscape), but they don't seem to animate the transitions between the views nicely like the Calc app does. I've also tried setting the frames for the views manually in willAnimateSecondHalfOfRotationFromInterfaceOrientation, but it doesn't seem to look "quite right" and also I'm not certain how that works with the autoresize mask. Any ideas how this is done? Thanks!

    Read the article

  • Phone crash when try to use vibration on Android

    - by Diego Unanue
    Im developing an app that when you click a button the phone has to vibrate, the issue is that the phone just chashes. Saing that I need permitions to vibrate. I've already set this permition in the build.setting (android manifiest). Here is the code build.settings: settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist= { CoronaUseIOS7LandscapeOnlyWorkaround = true, CoronaUseIOS7IPadPhotoPickerLandscapeOnlyWorkaround = true, CoronaUseIOS6LandscapeOnlyWorkaround = true, CoronaUseIOS6IPadPhotoPickerLandscapeOnlyWorkaround = true, UIApplicationExitsOnSuspend = false, UIPrerenderedIcon = true, UIStatusBarHidden = false, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "[email protected]", "Icon-60.png", "[email protected]", "Icon-72.png", "[email protected]", "Icon-76.png", "[email protected]", "Icon-Small.png", "[email protected]", "Icon-Small-40.png", "[email protected]", "Icon-Small-50.png", "[email protected]", }, }, }, android = { permissions = { { name = ".permission.C2D_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.INTERNET", "android.permission.VIBRATE", }, }, } the file that uses the vibration is: local onButtonEvent = function (event ) system.vibrate() end I read all post in Corona page without success. Can I see the android manifest to see if the permissions are there. I've read that is a Corona issue not sure.

    Read the article

  • Procedural world generation oriented on gameplay features

    - by Richard Fabian
    In large procedural landscape games, the land seems dull, but that's probably because the real world is largely dull, with only limited places where the scenery is dramatic or tactical. Looking at world generation from this point of view, a landscape generator for a game needs to not follow the rules of landscaping, but instead some rules married to the expectations of the gamer. For example, there could be a choke point / route generator that creates hills ravines, rivers and mountains between cities, rather than cities plotted on the land based on the resources or conditions generated by the mountains and rainfall patterns. Is there any existing work being done like this? Start with cities or population centres and then add in terrain afterwards?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >