Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1212 times and has 3 replies Next Thread
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Add text

Hello everyone

I want to make a new addition to my plugin. Adding text in a simple way.

Adding it to a point on the stage (in the plan) that is red and has a text height of 38 and a position like 10,10.

post content

Deneme1
Deneme2
Deneme3

It is in the form. Thanks in advance to my helpful friend.
[Dec 21, 2024, 1:16:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Re: Add text

public void yazilariEkle() {
// Belirtilen metin
String text = "Deneme1 :\nDeneme2 :\nDeneme3";
Home home = getHome();


TextStyle textStyle = new TextStyle(12);
textStyle.setColor(Color.RED);
textStyle.setFontName("Arial");
textStyle.setFontSize(38);

Label label = new Label("text", 10, 10);
label.setStyle(textStyle);

home.addLabel(label);
}
[Dec 21, 2024, 1:22:33 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9418
Status: Offline
Reply to this Post  Reply with Quote 
Re: Add text

There is no setter in TextStyle class, but you seem to be on the right path.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Dec 21, 2024, 6:18:29 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
k005
Member



TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Re: Add text

Yes. However, a small sample is required. How can any furniture, box or text be added to the scene?
[Dec 22, 2024, 1:57:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

  Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads  
© Copyright 2024 Space Mushrooms - All rights reserved