Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Is possible centered a text in 2D overlay?

misterpaint
Registered User
Quote
2023-01-14 00:22:09

hello! I need of put a text centerd in a "2Doverlay", but I can only put the text to left, there is effectly a solution for that?

Thank you!


Guest
Guest
Quote
2023-01-14 00:39:50

You can change the Alignment property of the 2D Overlay to center. It should be that way by default. Maybe you changed it?


misterpaint
Registered User
Quote
2023-01-14 00:42:36

never worked with C6, if I put it in the center I always see it on the left


Guest
Guest
Quote
2023-01-14 00:48:41

🔎︎


Does your settings look like this?


misterpaint
Registered User
Quote
2023-01-14 01:00:04

I'm sorry, I forgot to mention that my text is multiline, and I need a centered text
Are there scripts or similar to intervene externally in some way?

Thank you for the time spent for me


Guest
Guest
Quote
2023-01-14 01:25:30

You would have to do so in JavaScript I believe. I'm not sure what you are doing, but you can format strings in different ways via code. Here's a small example:


var s = ccbGetSceneNodeFromName("2D Overlay1");

var t = "\t\t\t\tThis is a\n" + "\t\t\t\tmultiline text."

ccbSetSceneNodeProperty(s, "Text", t);


You can learn more at:

https://www.w3schools.com/js/js_...


misterpaint
Registered User
Quote
2023-01-14 20:26:18

Cool!
I'm trying this example, but the text doesn't view in multiline

I am saddened that I can’t get it to work :(


misterpaint
Registered User
Quote
2023-01-14 20:32:05

So I see the text with the script
🔎︎



Guest
Guest
Quote
2023-01-14 20:48:09

Here's an example ccb of the code above:

https://files.catbox.moe/2mlu5h....


misterpaint
Registered User
Quote
2023-01-15 01:11:41

ok, I figured out what the problem is, is that I’m exporting in webgl, and it doesn’t work unfortunately :(
Only work by exporting . exe , but I need to export in webgl

Thank you for your file! too kind.


Create reply:


Posted by: (you are not logged in)


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