@VlaDi4eKK wrote:
Hello, this problem. I am writing on cocos2d-js. When
I started to do the project, always the dough on the emulator, then
somehow I got carried away and for a long time test right from the
browser. So: the application uses ccui.PageView. He has EventListner, which uses the event after turning to the next page. I
Faced with the fact that now my code is fulfilled perfectly in the
browser, but when you start the emulator does not work event! Those. I turn the pages, but the event itself after turning no. Tested in different ways, zero reaction. In the instructions, and used in the tests are absolutely the same structure and a same event handling method of turning. What could be the problem? Why one and the same code is not executed? I'm aware that js Bindi to positive realizations, and there comes a compilation on iOS. The code should work, but the event does not work. = (var cards_view = new ccui.PageView(); cards_view.setTouchEnabled(true); cards_view.setContentSize(cc.size(this.size.width, this.size.height)); cards_view.setAnchorPoint(cc.p(0.5, 0.5)); cards_view.x = this.size.width / 2; cards_view.y = this.size.height / 2; for (var i = 0; i < img_block_kitchen.length; i++) { var page_card = new ccui.Layout(); ... ... ... cards_view.addPage(page_card); } cards_view.addEventListener(this.pageViewEvent, this);
pageViewEvent: function(sender, type) { switch (type) { case ccui.PageView.EVENT_TURNING: this.index_current_page = sender.getCurPageIndex(); ... ... ... break; } },
Posts: 2
Participants: 2