Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Make 2d interface show number of a variable

hanicraft
Registered User
Quote
2022-12-15 19:12:43

I'm wanna make the 2d interface show content of a variable and update it when it changed
I'm want to make text health bar using this method


samgrady
Registered User
Quote
2022-12-15 20:04:23

you do it with js?


hanicraft
Registered User
Quote
2022-12-15 23:16:53

wrote:
you do it with js?

i dont know
if i can make it without coding its better
but i dont how to make it in js


samgrady
Registered User
Quote
2022-12-16 14:51:18

if i can make it without coding its better
if use "Game Actor with Health" you can use on your 2d overlay node "Every few seconds do something" and inside action set "Execute Java Script" inside of script write this line:
ccbSetSceneNodeProperty(ccbGetCurrentNode(),"Text",ccbGetCopperCubeVariable("player_name.health"));
"player_name" is name of yor node with "Game Actor with Health", done now set update speed in "Every few seconds do something".
🔎︎



samgrady
Registered User
Quote
2022-12-16 15:17:00

hashtag before player_name.health, forum deleted this combination


Create reply:


Posted by: (you are not logged in)


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