Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
2d node width
Author Text

coa
Registered User
Quote
2022-03-21 10:57:02

Im trying to change a 2d node width with execute javascript. but i have not find much help about it..

I tried this
ccbSetSceneNodeProperty(this, 'Width (percent)', 1)

but it did not work


sven
Registered User
Quote
2022-03-21 12:18:45

for me it works.
i tested it with 2doverlay when click on it then execute javascript.
(that means currentnode will be overlay then)

ccbSetSceneNodeProperty(ccbGetCurrentNode(), 'Width (percent)', 1);

Depends what is THIS means in your script.
Also did you got any error printed on log?


coa
Registered User
Quote
2022-03-21 12:30:08

hi sven thanks for your reply and help I did not know what to put instead of "this"

I was adding 2d node that changed width by variable


sven
Registered User
Quote
2022-03-21 12:50:15

wrote:
hi sven thanks for your reply and help I did not know what to put instead of "this"

I was adding 2d node that changed width by variable


You need to know what to put there -otherwise you cant properly use it.

You can specify it with function "getfromname":
var myTHIS = ccbGetSceneNodeFromName("MY-THIS-NAME-HERE");
ccbSetSceneNodeProperty(myTHIS, 'Width (percent)', 1);

Check here for functions and usage:
https://www.ambiera.com/coppercu...


coa
Guest
Quote
2022-03-21 14:09:34

yeah thats why i was asking for help did not find any info.

thanks again for your help and suggestion


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (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© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact