Author Topic: X-Frame and World Political Map  (Read 314 times)

Adehlin

  • Newbie
  • *
  • Posts: 30
    • View Profile
X-Frame and World Political Map
« on: February 26, 2019, 04:40:38 AM »
Hi,

I'm using your World Politcal Map together with X-Frame (and Beautify) to provide 3 different quality settings. Basically:
Low = X-Frame (Beautify disabled)
Normal = Beautify (X-Frame disabled), Best Performance, Bloom off
High = Beautify (X-Frame disabled), Best Quality, Bloom on, PostProcessing (anti-aliasing)

The user can set the different levels in run-time, via a toggle group.

The issue I'm having is when the user selects Low (i.e. X-Frame gets enabled). The interaction with the globe acts weird. Most of the time it doesn't work at all (i.e. I can't rotate the globe), except for the zoom which is always working. Sometimes I can interact with the globe but it's not very responsive and after a couple of seconds it's no longer interactable. This issue occur both in the Unity editor as well on a mobile device.

I've been using X-frame out-of-the-box settings more or less:
https://imgur.com/a/m4RYVgo

In the WPM, I'm using Camera Rotates and Camera Moves.

Is there something I've missed?

Thanks!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4662
    • View Profile
Re: X-Frame and World Political Map
« Reply #1 on: February 26, 2019, 07:23:21 AM »
Hello,

The input mouse positions need to be adjusted to take into account the downsampling applied by X-Frame using the AdjustScreenPosition method of X-Frame API (take a look at X-Frame manual, page 9 "Custom APIs for dealing with UI and GameObject interactions").

In Globe Edition, look for Input.mousePosition and replace that by XFrameManager.instance.AdjustScreenPosition(Input.mousePosition).

Regards


Adehlin

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: X-Frame and World Political Map
« Reply #2 on: February 26, 2019, 03:54:09 PM »
Hi,

One step forward, but when clicking/tapping outside of the globe (e.g. in the skybox) it won't work any longer. After a click/tap it's not possible to interact with the globe unless I disable/enable the X-Frame component.

I've reviewed the WPMinternal script but am struggling to identify what's causing this new issue.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4662
    • View Profile
Re: X-Frame and World Political Map
« Reply #3 on: February 26, 2019, 04:09:02 PM »
It maybe the OnMouseEnter no longer being called (which sets the mouseIsOver to true).
Will take a look tomorrow.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4662
    • View Profile
Re: X-Frame and World Political Map
« Reply #4 on: February 27, 2019, 04:15:12 AM »
Add this line at the begining of the Update () method in WPMInternal.cs:

Code
void Update() {

            mouseIsOver = true;
...

Adehlin

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: X-Frame and World Political Map
« Reply #5 on: March 01, 2019, 02:53:24 PM »
Hi,

Sorry for late reply!

I can confirm this simple line of code solved the problem. Thank you very much for the support! :)