How to resolve the algorithm Animation step by step in the Maple programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Animation step by step in the Maple programming language
Table of Contents
Problem Statement
Animation is integral to many parts of GUIs, including both the fancy effects when things change used in window managers, and of course games. The core of any animation system is a scheme for periodically changing the display while still remaining responsive to the user. This task demonstrates this.
Create a window containing the string "Hello World! " (the trailing space is significant). Make the text appear to be rotating right by periodically removing one letter from the end of the string and attaching it to the front. When the user clicks on the (windowed) text, it should reverse its direction.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Animation step by step in the Maple programming language
Source code in the maple programming language
ScrollText(GP("Text",value),"Forward",65);
ScrollText(GP("Text",value),"Reverse",65);
macro(SP=DocumentTools:-SetProperty, GP=DocumentTools:-GetProperty);
SP("Text",value,"Hello World! ");
ScrollText := proc( msg, direction::identical("Forward","Reverse"),n::posint:=20 )
local word, count;
word:=msg;
count:=0;
while count
if direction = "Reverse" then
word:=cat(word[2..-1],word[1]):
else
word:=cat(word[-1],word[1..-2]):
end if;
SP("Text",value,word,refresh);
Threads:-Sleep(0.1);
count:=count+1:
end do:
end proc:
You may also check:How to resolve the algorithm Bitmap/Bézier curves/Cubic step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Loops/N plus one half step by step in the Modula-3 programming language
You may also check:How to resolve the algorithm Arithmetic-geometric mean step by step in the REXX programming language
You may also check:How to resolve the algorithm Bioinformatics/base count step by step in the jq programming language
You may also check:How to resolve the algorithm Parametric polymorphism step by step in the F# programming language