Search Unity

xARM: Aspect and Resolution Master [v1.9]

Discussion in 'Assets and Asset Store' started by Thavron, Aug 16, 2013.

  1. bvesco

    bvesco

    Joined:
    Jul 7, 2013
    Posts:
    3
    Note for people using 2D Toolkit with xARM.

    Yes, you MUST turn off "force resolution" on your tk2dCamera. Also, switching between auto-scale modes on your camera overrides does not always update properly in xARM. The way I finally got it to work with "Fit Width" was to deactivate "force resolution", turn off xARM's "edit" preview setting, then mess around with game view setting it to a few different ratios. I put game view back into free aspect and re-enabled "edit" in xARM gallery which then showed the correct previews with my camera settings.

     
    Thavron likes this.
  2. minhkhue

    minhkhue

    Joined:
    Jul 26, 2013
    Posts:
    2
    Hi,

    I got this error each time when i start the preview window or i change the resolution (standardalone,....)

    NullReferenceException: Object reference not set to an instance of an object
    xARMManager.ResizeGameView (Vector2 newSize) (at Assets/xARM/Managers/xARMManager.cs:545)
    xARMManager.UpdateScreenCap (xARM.xARMScreenCap screenCap) (at Assets/xARM/Managers/xARMManager.cs:435)
    xARMPreviewWindow.Update () (at Assets/xARM/Windows/xARMPreviewWindow.cs:118)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:185)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:178)
     
  3. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Hi minhkhue,

    I just saw your post. This error looks odd...

    Please delete and reimport xARM by following these steps:
    1. Backup all xARM code changes you may have done
    2. Delete the /xARM folder from your Project
    3. Ensure Unity is closed
    4. Backup and delete xARMSettings.xml (see /ProjectSettings folder)
    5. Open Unity and reimport xARM from the Unity Asset Store
    Did you change xARM's code? For example added some custom ScreenCaps?
    If the above doesn't fix the problem please let me know.
     
  4. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.05.372 is awaiting approval and should be available soon (btw sale ends also soon ;)).
    It adds hotkeys and the "hide Game View" feature. Yay!
     
  5. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.05.372 is available at Unity Asset Store.
    Let me know how you like it.

    Changelog:
    + Export hotkeys:
    + Export xARM Preview's active ScreenCap by ctrl/cmd+alt+e
    + Export all xARM Gallery ScreenCaps by ctrl/cmd+shift+alt+e​
    + Hide Game View via:
    + Hide Game View button in xARM Preview and xARM Gallery
    + Unity's menu
    + Hotkey: ctrl/cmd+alt+g​
    xARM Options:
    + "Hidden Game View Position" added
    + Its possible to test/activate the fixed and hidden Game View position from xARM Options​
    + Updated documentation
    + Bugfix: Changing the fixed position of the Game View instantly takes effect
    + Bugfix: Fixed bug that caused the Game View to move to default position
    + Other minor tweaks to improve Game View handling​
     
  6. graviton

    graviton

    Joined:
    Jan 11, 2013
    Posts:
    75
    @Thavron

    I'm new to xARM

    Game View keeps popping up on the screen every time I choose a new device resolution, even after I've dragged it off screen

    CTRL doesn't do anything
    I've tried setting fixed and hidden Game View positions, but it doesn't help

    I can't check my resolutions if the Game View window keep popping up in front of my Preview and Gallery windows

    what am I missing
     
  7. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Hi graviton.
    Thanks for purchasing xARM.

    Do you mean the "hide Game View" hotkey (ctrl/cmd+alt+g)?
    Please use the menu item under Window->xARM or Tools to switch between un/hidden positions.
    Reopening the Game View might also help.

    On Windows a good workflow is to move the Game View to the hidden position, enable xARM Preview's auto update on Edit and use xARM Gallery's manual 1x update when needed (Edit deactivated).

    If the above doesn't help:
    I guess you're using the latest xARM version (1.05.372).
    What OS, OS version and Unity version are you using?
    Do you get any warnings on console or in xARM Preview/Gallery?
     
  8. graviton

    graviton

    Joined:
    Jan 11, 2013
    Posts:
    75
    @Thavron

    Got it
    I was inputting the hotkey wrong

    thanks for the help
     
  9. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM is part of this month's Level 11 sale.
    60% off!
     
  10. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hi,
    I'm having an issue with the iPhone 6 (750x1334) resolution; it doesn't look like the preview that xARM is showing. Are you aware of this bug ? It's quite frustrating, i was relying on xARM for all these resolution thing and now i have to start over ? Glad if you can help me out.
     
  11. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Hi PeteLaChatte and thanks for purchasing.
    I'm not aware of any bugs causing incorrect previews.
    Are you using platform/device specific code?
    If yes, you can call it by xARM's Delegates before updating the ScreenCaps (see xARM User Guide).

    If you need further help please let me know.
     
  12. rafaellop

    rafaellop

    Joined:
    Feb 4, 2015
    Posts:
    26
  13. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Next xARM version will include iPad Pro. It'll be available soon.
    If you can't wait you can add it as a custom ScreenCap. :)

    Thanks for your feedback.
     
  14. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.05.378 is submitted to the Asset Store and awaiting approval.

    Changelog:
    + new ScreenCaps:
    + iPad Pro​

    + existing ScreenCap description updated to include:
    + iPhone 6S
    + iPhone 6S Plus
    + iPod touch 6.
    + iPad mini 4
    + Nexus 5X
    + Nexus 6P​

    + Changed ScreenCap sample device order so that the first is the most current
     
  15. rafaellop

    rafaellop

    Joined:
    Feb 4, 2015
    Posts:
    26
    Thanks for the quick action :) Cheers, Rafal
     
    Thavron likes this.
  16. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.05.378 is available at the Asset Store.
     
  17. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Level 11 sale ends soon.
    Don't miss it!
     
  18. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    Hi I purchased your asset and I have a problem.
    I did the following:
    1) I creted a uGUI button, anchors in the center
    2) Configured the canvas to "Constant Physical Size"
    3) Configured de DPI of my monitor in the xARM options, my DPI is 96 according to a website made to check this.
    4) My xARM preview window is configured with 1:1phy
    5) I measured the size of my button with a phisical ruller, is 1cm

    Then I change the device preset and the phisical size of the button should be the same 1cm right?. I check the size of the button again with the phisical ruller and it's in a different size not 1cm anymore, every device changes my button to a different size. What I'm doing wrong?
     
    Last edited: Dec 6, 2015
  19. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Hi fermmmm.
    Thanks for purchasing xARM.

    uGUI's physical scaling uses the DPI value reported by the device. Unfortunately some devices give incorrect or no DPI value. Because of that I don't recommend using it.
    I recommend using anchors with scaling (+ atlas switching), because it works on all devices and is faster to create.

    If you want to use it nevertheless you can use xARM's Delegates to pass the current ScreenCap's DPI value into your UI code.
    Please let me know if you need further informations.
     
  20. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    uGUI's scaling mode is not very good, for example I want a button to have more or less the size of the finger for confort in that button, with scaling mode I don't have control of that, and if I want to make a small button it's probably going to be too small in the smaller screens.

    How can I pass the screen DPI value to the UI code? I see a problem there because in the canvas the scale value cannot be changed anymore in the recent versions of Unity. Maybe I have to make some sort of container to scale the UI? Maybe that is the reason why xARM does not support the physical scaling mode.
     
    Last edited: Dec 7, 2015
  21. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM changes the resolution (and aspect), but unfortunately Screen.dpi can't be overwritten. In Editor DPI is set to the monitor's dpi (or 0).
    CanvasScaler uses the Screen.dpi:
    Code (CSharp):
    1. protected virtual void HandleConstantPhysicalSize()
    2.         {
    3.             float currentDpi = Screen.dpi;
    4.             float dpi = (currentDpi == 0 ? m_FallbackScreenDPI : currentDpi);
    5.             float targetDPI = 1;
    6.             switch (m_PhysicalUnit)
    7.             {
    8.                 case Unit.Centimeters: targetDPI = 2.54f; break;
    9.                 case Unit.Millimeters: targetDPI = 25.4f; break;
    10.                 case Unit.Inches:      targetDPI =     1; break;
    11.                 case Unit.Points:      targetDPI =    72; break;
    12.                 case Unit.Picas:       targetDPI =     6; break;
    13.             }
    14.  
    15.             SetScaleFactor(dpi / targetDPI);
    16.             SetReferencePixelsPerUnit(m_ReferencePixelsPerUnit * targetDPI / m_DefaultSpriteDPI);
    17.         }
    Complete source: https://bitbucket.org/Unity-Technol...Scaler.cs?at=5.2&fileviewer=file-view-default

    But you can input the ScreenCap's DPI into your GUI code. As you've already written scaling the UI/Canvas is one option.
    Two other options:
    1. Call SetScaleFactor() and SetReferencePixelsPerUnit() from xARM's Delegates
    2. Derive a custom class from CanvasScaler and override HandleConstantPhysicalSize()
    I think #1 is the best way. I'll investigate it further. It is also on my RFE list to support this out of the box.

    xARM v1.05.380 is awaiting approval since yesterday. Accessing the updating ScreenCap from inside a xARM Delegate is now easier:
    Code (CSharp):
    1. Debug.Log ("PreUpdate: " + xARMManager.UpdatingScreenCap.DPI + "dpi");
     
  22. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    @fermmmm:

    I've done some further testing of idea #1 and it works pretty well.
    uGUI Delegate off vs. on:
    uGUI Delegate off.png uGUI Delegate on.png

    As you can see on the right image (wip uGUI Delegate on) the UI has the same size if the screen size is the same, different resolutions doesn't effect this (see left image for reference: same resolution -> same size).

    I've planned to include this feature in the next xARM update coming soon.
    If you like I can give you the wip version for using/testing.
     
  23. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    I sent you my oder number. How this new version works? I need to use a custom implementation of CanvasScaler?
     
  24. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.05.380 is available at Unity Asset Store.

    Changelog:
    Easy access from Delegates to the updating ScreenCap​

    No, you don't need to change anything of your uGUI stuff. The Delegate works with the original uGUI CanvasScalers (at least with 5.2).
    I've sent you the current wip version of the script.
     
  25. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
  26. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM is on SALE!
    Don't miss it!
     
    Last edited: Apr 13, 2016
  27. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6 is awaiting approval at the Asset Store.
    It adds support for Unity 5.3 & 4.7.

    Why 1.6 and not 1.06.xyz?
    Doesn't look like a big difference, but after changing my workflow* to enable a more agile development approach it was necessary to change the versioning scheme.
    Hopefully you will get new features and bugfixes with less delay.

    Unity 3.x is no longer supported. Let me know if that's an issue for you.

    Changelog:
    *I switched from Mercurial/Hg to Git (Git Flow, Sparse Checkout and Staging FTW ;)).
     
  28. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    Hi. I've just bought this and already I can see it saving me loads of time going forward.

    I noticed you have added some hotkeys recently, and I would love it if you could add (if this is possible technically) some hotkeys for the preview panel for "Next resolution" and "Previous resolution" so that just a keyboard command can be used to cycle through the resolutions. I suffer from RSI occasionally, so I'm always looking for any keyboard shortcuts that can reduce repetitive clicking on dropdown lists. Is there any chance something like this could be added?
     
  29. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    I'm glad you like it.

    Thanks for this RFE. I'll see what I can do.

    Feel free to give further feedback and a review :)
     
  30. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6 is now available at Unity Asset Store.
     
  31. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.1 is awaiting approval at Unity Asset Store.

    @fermmmm: The wip of the uGUI Canvas Scaler Delegate I sent you is now obsolete.

    @chmodseven: Hotkeys! :D

    Changelog:
     
    fermmmm likes this.
  32. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    What will happen with Unity 5.4? I'm using it and I see that the scaling feature of xARM is officialy implemented. This is good news for you since the window scaling solution is very dirty and is no longer neccesary right?
     
  33. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Seams like Unity was "inspired" by xARM to add the Game View scaling feature in 5.4. I feel honored*. ;)
    But they only added scaling, no physical size preview or anything else that xARM offers.

    So this Unity feature is indeed good for xARM. It enables new features.
    Using a docked Game View is #1, although I wouldn't call the current behavior "very dirty" :)

    *in case they were inspired by xARM...
     
    Last edited: Feb 24, 2016
  34. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    If you're using Unity 5.3+ & xARM 1.6/1.6.1 & Playmaker you might get the following error:
    If you can't wait for the next release, here is the quick fix:
    Replace line 722 in xARMManager.cs
    Code (CSharp):
    1. return SceneManager.GetActiveScene().name;
    with
    Code (CSharp):
    1. return UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
    New xARM version coming soon.
     
  35. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    Thanks for the hotkeys - works great.

    Looking forward to see what you are able to do with 5.4 new features - having it work a dockable game view would make this asset perfect.
     
    Thavron likes this.
  36. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.1 now available at Unity Asset Store.

    Thanks. I'm glad you like it. Feel free to suggest further features.
    And perfection is the goal. ;)
     
  37. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.1.1 is awaiting approval.
    It fixes the above mentioned error.

    Changelog:
     
  38. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.1.1 is now available at Unity Asset Store.
     
  39. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.2 is awaiting approval.
    Unity 5.4 (beta) support and some other things.

    Changelog:
     
  40. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.2 is now available for download at the Asset Store.
     
  41. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    Is docked game view supported in 5.4 already?
    Is possible to suport that?
     
    Last edited: Apr 5, 2016
  42. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    No. v1.6.2 supports Unity 5.4 with the known feature set.
    Adding docked Game View support is a bigger tasks, but I don't see anything that makes it impossible.
     
  43. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    Sale is over. Thanks to everyone who purchased xARM.
    Feel free to request features. Also reviews are appreciated.
     
  44. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    My second asset "xCBM: Color Blindness Master" will soon be available at the Asset Store.
    Feel free to give feedback and request features.

    Gallery first glimpse Text.png
     
  45. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    @djgriff:
    I've got an email with your post regarding an issue with xARM 1.6, but I can't find it here.
    I guess it is no longer an issue?
    If it is still an issue please let me know by forum or email.
     
  46. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    xARM v1.6.3 is now available.
    It improves support for xCBM (which is awaiting approval) and fixes some minor bugs.

     
  47. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Hey sorry for the delayed reply, sorry yeah got it figured and sorted now. thanks though great product saves me heaps of time!
     
    Thavron likes this.
  48. Thavron

    Thavron

    Joined:
    Aug 29, 2012
    Posts:
    364
    I'm glad you like xARM. Feel free to give further feedback and a review in the Asset Store. :)
     
  49. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Will do !
     
    Thavron likes this.
  50. ctc5301

    ctc5301

    Joined:
    Jan 28, 2016
    Posts:
    16
    Hi,
    Does anybody encounter the same problem with me? I use a 3rd party UI addon called "DoozyUI". When xArm is launched, DoozyUI could not tell the clicking on some of the buttons under some display aspect ratios in the game view. (For my case, free aspect & 16:10 fail. Others work well.). I am sure it works well when xArm is not launched. And the behaviours on my physical devices work well either.