txt orientation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
fm31
Posts: 22
Joined: Tue Apr 23, 2013 2:08 pm

txt orientation

Post by fm31 »

Hello


Is it possible to rotate a text with a angle [0 .. 360] with the possibility to continue to change it as a real field ?

Thanks for help

fm31
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: txt orientation

Post by Klaus »

Hi fm31,

no, that is currently not possible, at least the editing.

You can get away with taking a snapshot of your text field and rotate (set the angle of img...)
the resulting image, but as I said, no more text editing in that case.


Best

Klaus
fm31
Posts: 22
Joined: Tue Apr 23, 2013 2:08 pm

Re: txt orientation

Post by fm31 »

thanks for answer

fm31
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: txt orientation

Post by MaxV »

Try this: http://tinyurl.com/mhj5t9l
It's a stack example of rotating text.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
fm31
Posts: 22
Joined: Tue Apr 23, 2013 2:08 pm

Re: txt orientation

Post by fm31 »

thanks maxV
but this is an image of the text and it's not possible to modify it
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: txt orientation

Post by Klaus »

fm31 wrote:thanks maxV
but this is an image of the text and it's not possible to modify it
Hm, didn't I tell you that this is not possible at all? See my first posting and read again!

Max is a nice guy but no magician! 8)
dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: txt orientation

Post by dave.kilroy »

@fm31 have another look at maxV's stack - there is a field as well as an image...
"...this is not the code you are looking for..."
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: txt orientation

Post by MaxV »

fm31 wrote:thanks maxV
but this is an image of the text and it's not possible to modify it
As dave.kilroy noted, you can modify the text clicking on it.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Not a lot of thought
Posts: 77
Joined: Thu May 21, 2015 2:41 am

Re: txt orientation

Post by Not a lot of thought »

maxV
Could you explain what you did there? I need to be able to modify the text via a variable as well as the size and location.
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: txt orientation

Post by MaxV »

There are 2 elements, the normal text field, and the image of it rotated.
The normal text field has this code:

########CODE#######
on Mouseleave
focus on nothing
send aggiorna to image uscita
set the visible of me to false
end mouseLeave
#####END OF CODE#####

the result image has this code:

########CODE#######
on aggiorna
export snapshot from rect (the rect of field ingresso) of this card to image uscita
set the angle of me to the tAngle of me
end aggiorna

on MouseUp
set the tAngle of me to the angle of me
set the loc of field ingresso to the loc of image uscita
set the visible of field ingresso to true
focus on field ingresso
end MouseUp
#####END OF CODE#####

It's a simple trick, you:
  • lock the screen (this way the user will not notice anything untill unlock)
  • modify the text
  • make visible your normal field
  • export as in image the normal field edited
  • make invisible the normal field
  • rotate the generated image
  • unlock the screen
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Not a lot of thought
Posts: 77
Joined: Thu May 21, 2015 2:41 am

Re: txt orientation

Post by Not a lot of thought »

how is the image created/where did if come from?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: txt orientation

Post by Klaus »

Not a lot of thought wrote:how is the image created/where did if come from?
Please read the thread, the magic word is "snapshot"! 8)
dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: txt orientation

Post by dave.kilroy »

The script instructs LiveCode to take a snapshot of the field thus:
MaxV wrote: export snapshot from rect (the rect of field ingresso) of this card to image uscita
If you spend time with the dictionary looking up key words you should find it easier to parse code samples on the forum...

EDIT: oops I see that Klaus answered this just before I did!
"...this is not the code you are looking for..."
Post Reply