Welcome, Guest

Author Topic: Accessing the Coherent.UI API  (Read 1088 times)

The Bear

  • Posts: 9
    • View Profile
Accessing the Coherent.UI API
« on: May 14, 2015, 06:46:56 PM »
I'm having some problem understanding how to access some parts of the API. Specifically the part under Classes -> Class List -> Coherent -> UI

So I have an instance of a CoherentUIView, how do I access e.g. the BrowserView for that instance and call .GoBack()?

Hristo

  • Guest
Re: Accessing the Coherent.UI API
« Reply #1 on: May 15, 2015, 02:35:55 AM »
Hi The Bear,

You just need to cast it like so - ((BrowserView)m_View.View).GoBack();   

Here's a more detailed example:

Code: [Select]
public class Test : MonoBehaviour {

public CoherentUIView m_View;

void Start()
{
m_View = GetComponent<CoherentUIView>();
}

void OnGUI()
{
if (GUI.Button (new Rect (10, 70, 50, 30), "Go back))
{
Debug.Log("Go back ");
((BrowserView)m_View.View).GoBack();
}

}
}

I'm sorry that this was not clear enough in our documentation. We are constantly working on improving it. Did you had trouble finding any other specific informaiton in our docs?

The Bear

  • Posts: 9
    • View Profile
Re: Accessing the Coherent.UI API
« Reply #2 on: May 15, 2015, 01:56:40 PM »
Thanks for the answer!

I am running into some more problems with the GoBack() functionality. Calling ((BrowserView)m_View.View).GoBack() (where m_View is a CoherentUiView) doesn't seem to do anything. I've made sure that I'm interacting with the window by calling m_view.View.SetZoomLevel(400) and that works.
Pressing backspace on a page will take me back to the previous one. Calling GoBack() on the other hand does not.

Bobby

  • Posts: 87
    • View Profile
Re: Accessing the Coherent.UI API
« Reply #3 on: May 18, 2015, 04:19:04 AM »
Hey The Bear,

This looks like a project specific issue. Can you please contact our support at support@coherent-labs.com. Please include a link to this thread along with all the details regarding your machine, Unity version, Coherent version. The email you send will automatically create a ticket in our support system where we can track and update the issue.

Tags: