txt orientation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
txt orientation
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
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
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
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
Try this: http://tinyurl.com/mhj5t9l
It's a stack example of rotating text.
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: txt orientation
thanks maxV
but this is an image of the text and it's not possible to modify it
but this is an image of the text and it's not possible to modify it
Re: txt orientation
Hm, didn't I tell you that this is not possible at all? See my first posting and read again!fm31 wrote:thanks maxV
but this is an image of the text and it's not possible to modify it
Max is a nice guy but no magician!
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: txt orientation
@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..."
Re: txt orientation
As dave.kilroy noted, you can modify the text clicking on it.fm31 wrote:thanks maxV
but this is an image of the text and it's not possible to modify it
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Re: txt orientation
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.
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
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:
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- Posts: 77
- Joined: Thu May 21, 2015 2:41 am
Re: txt orientation
how is the image created/where did if come from?
Re: txt orientation
Please read the thread, the magic word is "snapshot"!Not a lot of thought wrote:how is the image created/where did if come from?
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Location: Plymouth, UK
- Contact:
Re: txt orientation
The script instructs LiveCode to take a snapshot of the field thus:
EDIT: oops I see that Klaus answered this just before I did!
If you spend time with the dictionary looking up key words you should find it easier to parse code samples on the forum...MaxV wrote: export snapshot from rect (the rect of field ingresso) of this card to image uscita
EDIT: oops I see that Klaus answered this just before I did!
"...this is not the code you are looking for..."