nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.98k stars 1.29k forks source link

How do I get object IDs? #686

Closed ZuupahGeek closed 2 years ago

ZuupahGeek commented 2 years ago

Summary I am trying to learn about this program, and make a few changes for this project I'm working on at school. Right now, I'm trying to change the font on the text tool. I know the API tells me how to manually change things like Font-family and such, but I really can't wrap my head around how to actually do it! Where do i get the correct ID for changeTextStyle(id)? I'm guessing it has something to do with the activeObjectId or something, but I don't know how to find it!

Version react image editor 3.15.2

Additional context I'm working in React

lja1018 commented 2 years ago

@ZuupahGeek Thank you for the question. If you use the addText API, you must save the id in the returned Promise.

ZuupahGeek commented 2 years ago

Oh, I get it now! Thank you for the response! A follow-up question, if I may! The way I call the addText, I have to make my own instance on a button, for example! Is there a way I can "adjust" the original addText, that is in the node modules, rather than making another one?

lja1018 commented 2 years ago

@ZuupahGeek React requires access to the instance and use the API. I think you can bring an instance to the getInstance API and use it.

stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

stale[bot] commented 2 years ago

This issue will be closed due to inactivity. Thanks for your contribution!