Page 1 of 1

txt orientation

Posted: Mon Aug 03, 2015 2:21 pm
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

Re: txt orientation

Posted: Mon Aug 03, 2015 2:58 pm
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

Re: txt orientation

Posted: Tue Aug 04, 2015 9:41 am
by fm31
thanks for answer

fm31

Re: txt orientation

Posted: Tue Aug 04, 2015 2:34 pm
by MaxV
Try this: http://tinyurl.com/mhj5t9l
It's a stack example of rotating text.

Re: txt orientation

Posted: Wed Aug 05, 2015 2:31 pm
by fm31
thanks maxV
but this is an image of the text and it's not possible to modify it

Re: txt orientation

Posted: Wed Aug 05, 2015 2:37 pm
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)

Re: txt orientation

Posted: Wed Aug 05, 2015 2:37 pm
by dave.kilroy
@fm31 have another look at maxV's stack - there is a field as well as an image...

Re: txt orientation

Posted: Thu Aug 06, 2015 8:46 am
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.

Re: txt orientation

Posted: Mon Aug 31, 2015 2:57 am
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.

Re: txt orientation

Posted: Mon Aug 31, 2015 9:29 am
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

Re: txt orientation

Posted: Sat Sep 05, 2015 1:10 pm
by Not a lot of thought
how is the image created/where did if come from?

Re: txt orientation

Posted: Sat Sep 05, 2015 1:23 pm
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)

Re: txt orientation

Posted: Sat Sep 05, 2015 1:24 pm
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!