Sweet Home 3D Forum
No member browsing this thread
Thread Status: Active
Total posts in this thread: 4
k005
Member
TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status:
Offline
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]
[Link]
k005
Member
TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status:
Offline
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]
[Link]
Puybaret
Expert
France
Joined: Nov 7, 2005
Post Count: 9418
Status:
Offline
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]
[Link]
k005
Member
TURKEY
Joined: Aug 6, 2022
Post Count: 54
Status:
Offline
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]
[Link]