Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
i want to show the value on the screen.i've seen some ccp using this ,but i dont know the method |
||||
|
Check out Sven's answer to this post: https://www.ambiera.com/forum.ph... |
||||
|
Can you explain it?I cant get his words????.Thank you. |
||||
|
"You can use 2D overlay to display any text or image. ----DECLARE VAR---- NEW3DSCENE1 SetOrChangeVariable COINS=0 ----UPDATE---- NEW3DSCENE1 EveryFewSecondsDoSomething 100ms Change 2D OverlayText COINS= $COINS$ -----COLLECT A COIN---- SetOrChangeVariable COINS=COINS+1" Insert a 2D overlay in your scene. On the root scene node (New 3d Scene1 or whatever you have called it) in a "Before first draw" behavior use the "Set or Change a Variable" action to make your variable (Coins = 0). Now put an "Every few secs do something" behavior on that same root scene node.Sven sets it 100ms. That's 1/10th a second. Add the "Change a 2d overlay text" action to it. Add your 2d overlay and type in "COINS = $Coins$". Note the dollar signs around the variable. You need them for the variable to change. Now to collect the coin you can just use the default CC cube and add a "When clicked on do something" behavior to it and add the action "Set or Change a Variable" and type in coins then choose the add (+) operation and the value of 1. When you click on the coin it should update the the overlay. One thing I forgot: you need to have your 2d overlay set to "Draw text" and put something like 0 for the text. |
||||
|
You ve helped me a lot. Thanks very much! |
||||
|
Ha! I know why I cant realize it. I forgottto click "draw text".Hahaha... |
|