Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17117

C Listener to JS listener

$
0
0

@splinter wrote:

Hi

I have some working C++ code that I need to bind to js.

The C++ code does this..

  1. I have Object that describes an event received from my server. ex.

class ServerEvent {
 ... 
}
  1. I have a function that set the Listener and calls a function in that object when a new event is received.

void setEventListener( ServerEvent * Event)

I want to do the same from js, I already binded function setEventListener to Js and I am trying to pass js function so it will be called when an event arrives.

var doOnEventReceived = function( event )
{
cc.log( event);
...
}

sdkbox.pluginname.setEventListener( doOnEventReceived );

Any idea or sample code?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>