≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
how to show the exact value of a variable
Posted by:
(you are not logged in)
Enter the missing letter in: "I?ternational"
(you are not logged in)
Text:
[quote][b]Guest[/b] wrote: "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.[/quote]
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