Mobile games how to handle different resolutions in Unity and NGUI? - mobile

I have a mobile game developed by U3D and NGUI and targeted to platforms such as android and IOS, but there are so many mobile resolutions and aspect ratios change from 1.3 to event 2. My UI are designed under resolution 1136x640, and UIRoot Scaling style is FixedSize, Manual Height is 640.
I am not going to use anchors in NGUI widgets because distance is defined in pixels but not in percentages, when resolutions are changed, relative position of widgets are also changed, this is not what I want.
I refer this but still have no idea to handle this tricky problem perfectly, I need some suggestions on how to use NGUI in right way to handle different mobile resolutions.

The newest (3.x.x) NGUI allows you to use their new anchoring system. As you said, it is specified in pixels, however you can specify different targets and distances to different edges, and it will behave similarly to percentages.
Are you familiar with NGUI team videos explaining their new releases?
https://www.youtube.com/watch?v=6k5iIzKTEBQ
Some of the information there could be helpful, and playing with Custom settings of anchors either.
Another useful things is to create scaling script attached to root, which scales all elements down, basing on the detected dpi. If your UI is prepared for phones, you probably won't need all the buttons to take the same percent of the screen on tablets.

Related

Responsive UI design using Appcelerator Titanium framework

I am new in Appcelerator framework, I have developed one application in appcelerator, but that application looks good on IOS but for android its not look good.
I want to develop a screen which is responsive like html.
Is there any way to design appcelerator screen like responsive screen.
Thanks you.
Don't define width, unless calculated. iOS is fairly simple with only a handful different resolutions, on Android you never know what resolutions you might encounter.
Luckily, you can specify widths differently in Titanium than you can in HTML. For example
var view = Ti.UI.createView({
left: 20,
right: 20
});
This will make your view the width of the parent, with 20 padding right and left, the width will be calculated.
Also, always stick to native UI elements. So tabgroups, actionbar/navigationBar should all be used so you don't have to worry about cross platform support, styling and sizing of those elements.
Furthermore, most view should be put in ScrollView's when you don't know how tall the UI is going to be. It could fit on iOS, but not on a small Android device. Putting it in a scrollview will always fix the screen as the scrollview will automatically enable scrolling when the content is taller than what fits.
So conclusion
Width should be defined relative. Either with left/right properties, or calculated
If height of content is not yet known or not designed to be fullscreen wrap it in a scrollview
Stop thinking of apps as websites, start thinking of them as Apps. Layout works differently
Lastly, Appcelerator is the company, Titanium is the technology you're using :)

Touchscreen control size

How do you handle control size on touchscreen, so it is easily used?
I have seen most examples have TextBox Height set to 40 pixels, or buttons 40x40. So, when I make controls this size and use it on my 13" Full HD device. it is OK.
However, I have noticed that lately there are laptops with very high resolution (ex 3200x1800), and small screens (ex 13-14"). How do you handle such scenarios? They usually set text (app) size to 250% in display settings, although this is mandatory.
Do we programmers need to use text (control) scaling as parameter when building UI?
Writing a DPI–aware application is the key to making a UI look consistently good across a wide variety of high-DPI display settings. Applications that are not DPI–aware but are running on a high-DPI display setting can suffer from many visual artifacts, including incorrect scaling of UI elements, clipped text, and blurry images.
link: Writing DPI-Aware apps

640px or 1080px Width for Mobile Theme Design?

I'm struggling to understand what width size to design my mobile theme in. A previous design company drafted me an app design and it was all produced using a 640px wide template, this is the ideal size I want to create my new theme in because it works well with the outline icons I want to use which are 48px and this is the right size for the Navigation Bar.
However the coder who will be putting the mobile theme together has suggested I produce the theme at a width of 1080px which is almost double the width size I am currently using and I will not be able to size up the icons to fit this size.
I'd really appreciate some advice on this, I've read that it's also an option to create multiple sizes which automatically convert depending on which device is used.
It depends what kind of application are you talking about. If it is a website, then 320-480 is the ideal for portrait, around 640 for landscape.
If it is a native application, then you might want to use 1080p, because modern mobile phones support full HD apps. Therefore it will look much nicer & crisper.
Also you want to think about if its going to be responsive ( adapting to screen width ) or not.

Web App V Win App - Display differences

I have been searching for any info on this without success.
I am updating an application that has two versions. A WPF windows app and an MVC web app. The requirement is that they must look the same.
Why when I add an image of, say, 100px X 100px to both the image in the web app looks larger than the image in the win app?
If I add margins the space between the items looks more in the win app than it does in the web app.
I thought I was mistaken so I physically measured both and confirmed the differences.
I want the 100X100 image in both apps to look the same and do not want to up size as this will distort the image.
Can anyone explain why this would happen and any way I can get around it?
Many Thanks
Fred
Assuming no styling is being applied to the images either in XAML or CSS, they could still be different because WPF pixels are device independent.
I guess you could set the ScaleTransform of your WPF app to match the desired size, but remember this will be different depending on monitor size and Windows DPI settings.

How far do you go with Mobile First Responsive Design?

I'm retro-fitting a website for Mobile First Responsive Design (MFRD). My question is - how far do you go with the "Mobile First" part?.
For example - on the homepage I plan on having a list of upcoming events, say 4 or 5. On the mobile version I thought 2 would be enough to save screen real-estate. Should I load the other events in dynamically for the larger views, or should I just hide them since it will only be a few elements anyway?
Loading them dynamically for larger sizes means I have to attach an event to the window resize which typically gets fired every pixel. Even though I can offset that with Timeout, that's still a lot of client side checking is it not (even though it's not like users are constantly resizing their browsers).
I mean, even though you're designing for mobile first, you also have to consider the larger sizes right? Obviously larger JavaScript libraries and other assets that are needed for larger only you want to pull in later and not load for mobile - but how crazy do you want to get with the bandwidth saving?
What is the target market for the website? Are you making a completely responsive website that encapsulates smartphone to desktop? Or are you just concentrating on smartphone to tablet?
Mobile First really just means start your styling and content views at the smallest form factor and work up as the device dimensions get bigger. HTML, CSS (media queries) and jQuery all play a part to expand the UI and manipulate (show/hide) content elements as the browser gets bigger.
Take a look at Smashing Magazine, their responsive layout is one of the most extensive I have seen so far, it will give you an idea of how far you can take the MFRD or DARL (Device Agnostic Responsive Layout) methodologies.

Resources