Forum

You need to log in to create posts and topics.

Scrolling The UI

Is it possible to scroll the webpage loaded on the Unity UI on a raw image.

I have accept input true in HTMLUIPanel script but I'm not able to scroll it

Hmm what kind of scroll are you after? There's the element.scrollTo and element.scrollBy methods available so you could scroll the body like this:

// var myUIElement is the GameObject ref;
var document = myUIElement.GetComponent<HtmlUIPanel>().document;

// Scroll the body of the document by 100px on y:
document.body.scrollBy(0, 100);

I want to be able to control the scroll the web content on the Unity End by touch input

 

Quote from luke@kulestar.com on 30th April 2018, 7:35 pm

Hmm what kind of scroll are you after? There's the element.scrollTo and element.scrollBy methods available so you could scroll the body like this:

// var myUIElement is the GameObject ref;
var document = myUIElement.GetComponent<HtmlUIPanel>().document;

// Scroll the body of the document by 100px on y:
document.body.scrollBy(0, 100);

Is this already done somewhere in the project ?

He,y apologies for the delay I just realised I hadn't been subscribed to this thread - there's the "Drag to scroll" example scene which supports touch input too (as PowerUI maps touch input to mouse input as well as support for the full touch/ pointer web API). Essentially you just hook up the "mousedown" and "mousemove" events to a script included in that example scene and drag scrolling works from there.

Power UI is the international organization of stability the power to manage the state of elongation and generation of the series well. The forum has the detail of conversation with the logic of essaymama review to command the review of other great habits.

Want the latest updates? Check out the repositories.