Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Displaying an Objects rotation info in A 2d text Overlay

creaturefreak
Registered User
Quote
2018-06-11 09:26:21

Hi all,

Quick question I'm trying to display an objects rotation info xyz in a 2d overlay window while running the game...does anyone know how I can achieve this ? any help would be great.
I know how display info like $health$, and the basic variables..and also how to display the info in the Output window however in a 2d overlay it's stumping me.

thanks

CF


just_in_case
Moderator
Quote
2018-06-11 10:46:48

you can trigger a javascript action and then use this code...


var s = ccbGetSceneNodeFromName("cubeMesh1");
var rotation = ccbGetSceneNodeProperty(s, "Rotation");
ccbSetCopperCubeVariable("Display_Rotation", rotation)


Change "cubemesh1" with the name of the object you want to show the rotation... and "Display_Rotation" to any variable you want..

and then add a 2d overlay to display the variable by using $Display_Rotation$...



creaturefreak
Registered User
Quote
2018-06-13 16:14:39

Change "cubemesh1" with the name of the object you want to show the rotation... and "Display_Rotation" to any variable you want..

and then add a 2d overlay to display the variable by using $Display_Rotation$...


Ah! perfect, thank you so much.

CF


Create reply:


Posted by: (you are not logged in)


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