Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hey there, what I am doing right now: - I added a behavior ("Before first drawing do something ") at the root node. - There I added an action ("Execute Javascript"). - As JS I entered "sceneReady();" - This "sceneReady();" is catched by the website which adds another texture to a material of a model It works. But, now my question: let's say, I want to have multiple instances of the same copperlicht scene on the website. For every instance I want to be able to add a different texture from outside. I suppose the goal is, to put the engine in its own namespace/container/whatever, so that I can do something like "this.sceneReady();" ? You may notice, that I don't know much about how Javascript works. So let me apologize, if this is already answered somewhere. I obviously aren't even aware of the correct terms to search for the right thing. A bump into the right direction would be most appreciated. Thanks! |
||||
|
Well the first thing that comes to my mind is that for each iframe-instance of your game on the website you will have to have separate iframe-code written. So why don't you just create different iframe id's for each iframe-instance & create an id check in your game, something similar to: if window.frameElement.id is 1 than do action 1 That way, depending on a iframe's id that the game is being iframed in, you can have different textures or other actions in the game. |
|