[ widget that turns text horizontal ]

BNig bernd.niggemann at uni-wh.de
Sun May 29 14:52:48 EDT 2016


Bill:

in its most simple form you could script in a button

---------------------------------------------
local sTurning = false

on mouseUp 
   if sTurning = false then
      put true into sTurning
      put "This is Bills text" into tText
      set the displayText of widget "turnText" to tText 

      -- turnText it is a property, you script "set the <property> to value 
      set the turnText of widget "turnText" to true  
   else
      put false into sTurning
      set the turnText of widget "turnText" to false
   end if
end mouseUp 
---------------------------------------------

if that is what you want. It just turns the text until you click on the
button again.
While it is turning you can change other properties like text or speed or
textSize using different buttons. Look at the code of the sliders.

If you wanted it to turn by setting the angle I could give you a different
script.

Kind regards
Bernd






Wprothero wrote
> Bernd:
> Nice widget. I thought it would be interesting to make an animated text
> line display effect using this. Maybe there are better ways. I tried to
> get it to turn automatically and just watch for the turnAngle, but I
> couldn’t get it to start turning, from my script unless I set the
> turnAngle explicitly.
> 
> Any suggestions?
> Bill
> 
> But, I did:
> on mouseUp
>    showTheText "This is Bills text"
> end mouseUp
> 
> local curAngle
> local isTurning
> 
> on showTheText tText
>    set the turnAngle of widget "turnText" to 270
>    put 270 into curAngle
>    set the displayText of widget "turnText" to tText
>    --set the turnSpeed  of widget "turnText" to 2
>    put TRUE into isTurning
>    doTheTurn
> end showTheText
> 
> on doTheTurn
>    put the turnAngle of widget "turnText" into curAngle
>    if curAngle > 360  then
>       put false into isTurning
>    else
>       send "addTurn" to me in 0.02 seconds
>    end if
> end doTheTurn
> 
> on addTurn
>    add 5 to curAngle
>    set the turnAngle of widget "turnText" to curAngle
>    if isTurning then
>       doTheTurn
>    end if
> end addTurn





--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/widget-that-turns-text-horizontal-tp4705280p4705294.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the Use-livecode mailing list