jeudi 5 février 2015

Createjs DomElement Scrolling


Please can someone help...basically I have developed a game in JavaScript and used CreateJs for all my graphics. I am trying to add a full screen of text to the screen and have found the CreateJS DomElement to be really good, however I cannot get vertical touch scrolling (panning) working on a mobile. I'm pushing it to Android and IOS via Cordova.


I have mocked it up in JsFiddle (and notice on here I have a vertical scrollbar!) -


http://ift.tt/1Djb4wv



var container = new createjs.Container();
stage.addChild(container);

var content = new createjs.DOMElement("foo");
content.mouseEnabled = true;

container.addChild(content);
container.x = 10;
container.y = 10;


Here is the markup:



<div id="foo" style="z-index: 1; position: absolute; background-color: #111; color:#FFF; width:260px; height:260px; padding: 10px; visibility: hidden; overflow-y: auto;">
<b>Hello! I'm an HTML div.</b><br/><br/>
I am not rendered to the canvas, but I can be included in the display
list for positioning and transformations.<br/><br/>
This means I can contain any HTML content (rich text, forms, video,
etc), but I'm not a full part of the EaselJS display list.<br/><br/>
</div>


Is anyone able to help please? I am not sure I am doing it the right way for a mobile device, but as I say the DomElement seems to do most of what I need.


Any help would be really appreciated.





Aucun commentaire:

Enregistrer un commentaire