Add text

This topic has been viewed 4093 times and has 3 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
Post Reply New Topic
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Add text

Post by k005 »

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.
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Add text

Post by k005 »

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);
}
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Add text

Post by Puybaret »

There is no setter in TextStyle class, but you seem to be on the right path.
Emmanuel Puybaret, Sweet Home 3D creator
k005
Posts: 60
Joined: Sat Aug 06, 2022 1:23 pm
Country: TURKEY

Re: Add text

Post by k005 »

Yes. However, a small sample is required. How can any furniture, box or text be added to the scene?
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest