Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Feature request: CloneText()

Author
Message
Prime
User Offline
Joined: 15th Jun 2022
Location:
Posted: 24th Jul 2022 17:02
Is there a way to copy text the way a sprite can be copied with CloneSprite()?

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Jul 2022 17:31 Edited at: 24th Jul 2022 18:19
no but you could write a function to Get() various Text/Character properties from the Source and Set() the "Clone" manually.

meanwhile, i don't see a way to perfectly clone a given text object since some Get() commands don't exist like GetTextCharBold() or GetTextBold() (which, i can imagine a work-around being comparing GetTextTotalWidth()s and if the original is wider, the Clone should SetTextBold() ).

there are quite a few GetText() commands so you could come pretty close if your text uses all of the Set() commands.

just compared Set() vs Get()

of those Missing, i'd consider these essential:

i generally don't set text at the individual character level so perhaps GetTextCharAngle() could be used for GetTextAngle() functionality along with the Bold workaround mentioned above.

otherwise, nice to have:
Virtual Nomad
Moderator
16
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Jul 2022 19:03 Edited at: 24th Jul 2022 19:14
This post has been marked by the post author as the answer.
to finish the thought (for me):


meanwhile, Request added to the repo.
Prime
User Offline
Joined: 15th Jun 2022
Location:
Posted: 25th Jul 2022 01:21
This was my attempt in https://github.com/charlesgriffiths/agk-modules/blob/main/juice/shaker/shaker.agc



which I will update to


Thanks for taking the time.

Login to post a reply

Server time is: 2022-08-09 09:13:59
Your offset time is: 2022-08-09 09:13:59