Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi I'm making a bitcoin miner game kind of in a similar style to a block world game, where the player has to rush round collecting bitcoin Anyway since it's bitcoin I needs to show the player in a HUD how much bitcoin they have collected... that part is fine but it's showing only 6 digits after the decimal point. Even if the amount is like this: 0.05000000 I would like to show all the 8 digits after the decimal point even if there are just zeros but It only shows up to 6 always. Also it loads really slow. Here's my link: http://edkeyte.com/bitcoinminerr... |
||||
|
Are you using Javascript? Its really easy to use the Number.prototype.toFixed() to get what you want. Read more Here: https://developer.mozilla.org/en... So when you update the 2D node text in JS you will then do something like this: YourBitcoinAmount.toFixed(8) EX Code: var bitcoinAmount = ccbGetCopperCubeVariable("Bitcoin Variable Goes Here"); Also note that it also looks like your text doesn't quite fit into the node (the last zero is missing some pixels) Make sure you give enough space for the counter. |
||||
|
Thank you so much ishmaru, Actually I'm not using Javascript but I'll try to implement what you say above. Ver helpful thank you. I know it looks like the text doesn't fit but that full background is part of the same HUD so it has a lot a space so i'm not sure why it does that. I'll keep playing with it to try and fix it. Thanks ishmaru! Really grateful! |
||||
|
WOW! You were right! It was easy to do. When you said to use Javascript I froze and was afraid when you said that hahah but I added it and it worked. You did all the work to help me and I just copied and pasted and changed the names etc so I was lucky from your help but I'm very pleased! Thank you again! |
|