On a desktop, I can get this button to display nicely (in Firefox anyway, I only need it to work on very few browsers) and it scales appropriately.
http://www.coflash.com/svg/
However, on an iPad3, the icon changes size and seems to be cut off. I can't figure out why this is happening. I'm guessing it's because of the pixel density/higher DPI but I don't even know where to begin on getting around it.
Does anyone have any experience with this?
Related
So I am quite new to Unity Development, and I have run into a problem. I have two UI's in my game (two buttons), however, when I change the device from an Iphone 12 (landscape) to a Iphone 11 (landscape), the UI's ratio goes all whacky and it changes size. Is there any way I can prevent this? I will link photos below
So this is what it looks like if the camera is in the Iphone 12 landscape 'mode'
and this is what it looks like in Iphone 11 'mode'
The ratio and size of the UI goes all whacky. How do I fix this?
(a picture of my canvas inspector
One thing that comes to mind is to change the Canvas Scalers UI Scale Mode from "Constant Pixel Size" to one of the other options, depending on what works best for you.
Unfortunately, "Constant Pixel Size" is the default value and it usually breaks everything when building a full screen UI.
For canvas settings, use the "scale with screen size" option and play around with the values. If most of the resolutions look fine but there is a spesific one that straight up breaks your UI, you can write a script to check if its that resolution and change the canvas values.
For UI elements you can play around with the setting I circled in red.
Also you might want to check this thread.
I have a working SpriteKit app for my iphone 5; however, when I run the same app on my iphone 4* the background image gets clipped and my obstacle height calculations break. I have tried different scaleModes as well as adding a background.png and background#2x.png, but the smaller res picture is not working. I can determine the size of the display and explicitly pick the right image file, but this does not seam as elegant as I would have expected.
Yeah, I believe that in your case you do have to check the size of the display. As inelegant as it may be.
Check this answer out:
iOS not using -568h#2x.png
I'm using a full screen UIWebView to house/render an HTML5 application under iOS. Very much like Cordova/phonegap although I'm not using those. I try to make my webview size match the underlying display. Unfortunately, on retina displays, the value returned by self.view.bounds relies on the UIScreen scaling factor. So I get 1024x768 instead of 2048x1536. Not a huge problem except I then instantiate the UIWebView using the smaller bounds (after adjusting for the status bar) and some things get a bit jaggy. In particular, I use canvas at a couple of points and also rounded borders appear thick. To be clear, this isn't a case of scaled raster resources.
I'm not getting the full resolution of the screen using that UIWebView. Ideally, I'd like to set the screen scale to 1.0 but that doesn't appear to be supported. Any suggestions on how best to get full advantage of the screen?
The problem is most noticeable on the iPhone 5 simulator. I don't have that hardware to test on. iPad/new iPad I think has the problem but the jaggies aren't as noticeable.
Update: The more I look at this, the more I think it may be restricted to canvas.
Solution: In case anyone else gets here. Based on the answer below, I created all of my canvas elements with width and height multiplied by window.devicePixelRatio and then set their style attribute to have the original (device independent) size.
See https://stackoverflow.com/a/7736803/341994. Basically you need to detect that you've got double resolution and effectively double the resolution of the canvas.
Using UIImageView I am trying to animate an image sequence of 300 PNG files, it works fine on the simulator however on actual device this doesn't work at all and what i see is a blank sereen.
If I am right then this is possibly due to the large number of images (300 approx.) that I am trying to load and animate or is there any other issue. Please advise?
It will depend on how big the .png files are, which test device you're using etc. When you test on the simulator it has access to all the computers RAM, which is considerably more than an iPhone does. I'll try to improve my answer if you post up some code. It sounds like there is a better way to do it.
Have you tried using a small subsection of the frames (say 10) and see if that works? You could also profile your app and check whats going on that way?
When i maximize an air window that has no chrome (no system chrome, no flex chrome but i think it's the same even if only flex chrome is used) a few pixels on all sides go offscreen.
Anyone has a solution for this or knows why it happens?
It's actually easiest to set the air window to the size of the monitor, then set your custom UI to the size of the monitor minus a few pixels. That's the only workaround that I've come up with.
The only downside to this approach may be a small rendering performance loss, since the AIR window has to take alpha transparent pictures of everything behind the window, but this likely so minimal that it won't make a difference (I invite someone to benchmark this).