Sending data to an extension [QUESTION]

runimals

  • Posts: 215
Hi,

I would like to know how to send data to an extension variable in order to setup ad ids, usernames,  etc...

Thanks!

« Last Edit: March 24, 2014, 11:14:07 am by Jon »

Jon

  • *
  • Posts: 17524
Could you be a bit more specific about the source of the data? For example, if you're entering in an ad id - is that coming from a code block or some part of the Stencyl UI, or?

runimals

  • Posts: 215
OK, I will try.  ;)

For what I need now I believe I will have enough if the source data are global vars (game attribute) because I believe is the easiest way to input just a couple of strings.

But if you can develop it further, using other data sources, please explain it. Extensions are really interesting.  :)

Jon

  • *
  • Posts: 17524
Oh I see - so you want to access arbitrary information from the Objective-C / Java side of things?

The way you do it is by passing it into the function you call. For example, if you want to pass a user's score, you add a score parameter to the function you call and pass it through in that fashion.

Covered under How to Create an Extension (iOS) / How to Create an Extension (Android)
http://www.stencyl.com/help/view/how-to-create-native-engine-extension/