Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Return name of scene node

danzabian
Registered User
Quote
2012-05-22 16:24:47

I was just wondering if theres a function that will return the name of a scene node, i am trying to use an animator for more than one node and need the name of the node to determine which one has been clicked on, is this possible?

Thanks,
Dan


niko
Moderator
Quote
2012-05-23 21:59:19

Hm, usually if you have the scene node, the property .Name should do it. But maybe I'm missing something here?


danzabian
Registered User
Quote
2012-05-24 10:30:20

Hey Niko,
Thanks, .Name does indeed return the name of the Node, but what i really should have asked is if there is a way to get the name from a click.


The issue i am having is that i have an animator
var shieldclick = function(){						

// Determine which shield holder is being clicked

// ajax request for specific shield details

// elements
name.Visible=true;
name.setText('Name: '+shieldname);
ammount.Visible=true;
ammount.setText('Amount: '+shieldammount);
recent.Visible=true;
recent.setText('Recent: '+shieldrecent);
team.Visible=true;
team.setText('Team: '+shieldteam);
}


var animator = new CL3D.Animator On Click(engine.getScene(), engine, shieldclick);
shield1.addAnimator(animator);
var animator = new CL3D.Animator On Click(engine.getScene(), engine, shieldclick);
shield2.addAnimator(animator);


so Shield1 and Shield2 are using the same animator, so when i click this, is there a way to find out which one has been clicked? Like is there a variable that stores the active scene node? i know the variable 'this' stores the scene information, but i couldnt find anything that stored any info on the Node i have clicked.

Thanks for your help,
Dan


niko
Moderator
Quote
2012-05-24 17:12:47

One obvious way would be to put a variable into to the shieldclick function so that it knows the object you clicked on.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (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