How far its compatible to use Html Dom objects, when we are developing application using Cocos2d

Hi,

Can any one please tell me How far its compatible to use Html Dom objects, when we are developing application using Cocos2d? Because in the forum reply for Vertical scrollview and lower letters for text input box, given suggestion that u can use Html dom objet. Thats y am asking how will it effect on other parts of application like positioning and loading elements.

Thanks & regards,
Aparajita

that depend on your html and css skills,

if you are not good at html/css, the game engine provides cc.DOM and miniframework for you to play around

you can use cc.DOM.convert to convert most sprites and menuitem to DOM element, miniframework is like mini jquery, that also provides some function to move html elements

we will add cc.ControlEditBox to Cocos2d-html5 soon. this control will implement function of textinput box. please wait some day. thanks!

Are there any tutorials/samples using cc.DOM? I’m very familiar with html/css, and just want to add some text fields, but I’m not certain how to move the elements within cocos2d-html5 logic. I’ve seen a few of these questions without much in the way of explicit answers.

`var LoginLayer = cc.Layer.extend({

init:function () 
{
    this._super();
    var size = cc.Director.getInstance().getWinSize();
    var loginButton = cc.MenuItemImage.create(
            "res/loginUp.png",
            "res/loginDown.png", 
            this.login,
            this);
    loginButton.setAnchorPoint(cc.p(0.5, 0.5));
    var menu = cc.Menu.create(loginButton, null);
    menu.setPosition(cc.PointZero());
    this.addChild(menu, 1);
    // Create an HTML input element (preferrably in-line, not in the base html file
    // <input type="text" id="login"/>
    // Position it relative to the loginButton, or just be able to loginInput.setPosition() somehow.
    // Then inside of this.login() retrieve loginInput.val()
    loginButton.setPosition(cc.p(size.width / 2, size.height / 2));
},`

It would help a lot to know what functionality exists to assist with creating an element from an HTML string and getting a handle to that element, if any.

Thanks.

Hello, I’m trying to use the brand new cocos2d-js 3.7 version and I’d like to achieve an hybrid application made with canvas and DOM elements merged together. Could you please provide suggestions 1) is this feasible? 2) are there samples around?