Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Function: make visible via CL

kingkohle
Registered User
Quote
2011-05-24 19:51:03

Hi,

I try to make a scenenode visible when a function (wrote in CL) has been triggered. Is there some kind of reverse method that lets me use CopperCube-actions when this function in the code is called?

Otherwise I have to script it all in CL. Thats what I have so far but it isn´t working:
var onoverlay = function(o) {		
var disclaimer = scene.getSceneNodeFromName('node1');
disclaimer.hide = false;
};
Maybe somebody got a hint?



erik
Registered User
Quote
2011-05-25 08:29:54

Try using
yourNode.Visible = false;


It's all listed here:
http://www.ambiera.com/copperlic...




kingkohle
Registered User
Quote
2011-05-26 18:43:03

Thanks erik..
I wish there were some short examples in the documentation - could be helpful.
It sounds plausible but it isn´t working for me. Here is my code:

var engine = startCopperLichtFromFile('3darea', 'copperlichtdata/Check_ControlFF.ccbjs');

engine.On**Loading**Complete = function()
{
var scene = engine.getScene();
scene.setRedrawMode(CL3D.Scene.REDRAW_EVERY_FRAME);
}

showdisclaimer = function()
{
alert("1");
var disclaimer = scene.getSceneNodeFromName('node1');
alert("2");
disclaimer.visible = false;
alert("3");
};

//showdisclaimer();

I figured that it isn´t getting past "alert 2" - so there has to be something wrong with the "scene.getSceneNodeFromName('node1');"-part

Any ideas? Ps: I m using the copperlicht.js-file from the CC-version 2.5.3 - in case that matters somehow..
Thx


niko
Moderator
Quote
2011-05-27 08:28:56

The variable 'scene' is not global, and you cannot access it there. I guess your browser also would have told you that if you would have looked into the JavaScript console. :)


kingkohle
Registered User
Quote
2011-05-27 18:18:21

True. Making the variable global did the trick.. From there on it took me a while to figure I spelled "visible" instead of "Visible"..
My bad.. But thanks heaps


kingkohle
Registered User
Quote
2011-06-01 19:51:35

How could I possibly make a 2Doverlay dissappear after e.g. 10sec?! I find it hard to figure out since there are no tuts about this.. I wouldn´t like to show what I got so far because its ridiculous :)

Somebody got an idea?


niko
Moderator
Quote
2011-06-02 06:34:13

Create a 'every few seconds do something' event, and either set it to 10 seconds or set it to 1 second and let it count a variable up. If you use the second method, add a second action to it, making the object invisible if the variable is bigger than 10 (the 'if'-part is also an action).


KK
Guest
Quote
2011-06-06 22:07:46

Cool.. Thanks. With variables its working well


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact