Animation: Difference between revisions

Content added Content deleted
No edit summary
Line 2,420: Line 2,420:
SLEEP 100, 1
SLEEP 100, 1
LOOP</syntaxhighlight>
LOOP</syntaxhighlight>

=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
include "NSLog.incl"

_window = 1
_label = 1

void local fn DoIt
window _window, @"Animation", (0,0,480,270)
subclass textlabel _label, @"Hello World! ", (140,112,210,45)
ControlSetFont( _label, fn FontLabelFontOfSize( 36 ) )
ViewSetProperty( _label, @"MoveRight", @(YES) )
timerbegin , 0.1, YES
CFStringRef string = fn ControlStringValue(_label)
CFStringRef chr
BOOL moveRight = fn NumberBoolValue(fn ViewProperty( _label, @"MoveRight" ))
if ( moveRight )
chr = right( string, 1 )
string = fn StringWithFormat( @"%@%@",chr,left(string,len(string)-1) )
else
chr = left( string, 1 )
string = fn StringWithFormat( @"%@%@",right(string,len(string)-1),chr )
end if
textlabel _label, string
timerend
end fn

void local fn DoDialog( ev as long, tag as long )
select ( ev )
case _viewMouseDown
select ( tag )
case _label
BOOL moveRight = fn NumberBoolValue(fn ViewProperty( _label, @"MoveRight" ))
if ( moveRight ) then moveRight == NO else moveRight = YES
ViewSetProperty( _label, @"MoveRight", @(moveRight) )
end select
end select
end fn

fn DoIt

on dialog fn DoDialog

HandleEvents
</syntaxhighlight>


=={{header|Gambas}}==
=={{header|Gambas}}==