Hi,
I am still a beginner using RunRev Studio 4 (Windows) and am trying to figure out how to create a project, for web deployment,that includes animating a rectangle shape to move up and down on a screen, started by clicking a button. I've previously created this project in another program using JS, but that export can only work with Windows, and I would very much like to create it in RunRev allowing X-platform use, especially Mac. (I have friends and family with Mac's who currently can not view this.)
I am not sure how to create basic animations like this in RunRev and wonder if I would need the Animation Engine add-on to accomplish this. The animation in JS does use a formula that causes the down animation (following the up animation) to proceed at half the speed of the up segment. Complicating this, the speed of the up and down cycle starts at a specific number of cycles per minute (controlled by a user entered variable, with the default as 10), then is reduced each minute thereafter until the cycle is 6 per minute, which continues until the animations preset time in minutes is completed (default time = 15 minutes).
The animation is to help users pace their breathing and improve relaxation.
I suspect that this project can be created in RunRev, but I'm not sure where to start. The first challenge is the animation of the rectangle shape, then the more complex features can be added.
I would appreciate any leads, suggestions, links to examples.
Thanks for your help.
Kind Regards,
Basic Animation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 87
- Joined: Thu Jul 17, 2008 8:42 pm
Basic Animation
saratogacoach
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
Re: Basic Animation
Hi Saratogacoach,
I did a simple animation, not going up and down, but an exanding and contracting circle. It breathes at around 6.8/min. No regulation, no timer. It has an inspiratory and expiratory stop though. Inspiration/expiration is 1/2.
Would something like this work for you? If yes one could implement the other features.
Watch out, it is hypnotic and you start to see aftercolors, and don't forget to breathe when you turn it off...
And for your Apple friends it is called iBreathe...
(I use a Mac myself)
play around with it and tell me what you think.
regards
Bernd
I did a simple animation, not going up and down, but an exanding and contracting circle. It breathes at around 6.8/min. No regulation, no timer. It has an inspiratory and expiratory stop though. Inspiration/expiration is 1/2.
Would something like this work for you? If yes one could implement the other features.
Watch out, it is hypnotic and you start to see aftercolors, and don't forget to breathe when you turn it off...

And for your Apple friends it is called iBreathe...
(I use a Mac myself)
play around with it and tell me what you think.
regards
Bernd
- Attachments
-
- iBreathe.rev.zip
- (1.63 KiB) Downloaded 269 times
-
- Posts: 87
- Joined: Thu Jul 17, 2008 8:42 pm
Re: Basic Animation
Hi Bernd,
It has been a while since I've posted. Your help last year, as now, is very much appreciated!
Thank you for this example. It will take a little while for me to fully understand the script. My RunRev skills (limited as they were last year) are a little more limited now since I haven't practiced as much as I should have. But, like riding a bicycle, I think once I refresh my memory, I will become more familiaragain with the syntax .
iBreathe is quite impressive! Great design. Yes, quite hypnotic.
My project, written in JavaScript, uses a rectangular bar (112X351 in pixels) which is initially placed 1 pixel below the screen bottom (goes up and down by 350). Here is the primary script from that project which can serve as the basis for a similar RunRev script to duplicate the project in RunRev.
As you can see, inhaling and exhaling are each accompanied by an MP3 breath sound which is synchronized to the animation to provide the user with an "audio-visual" experience.
The controls needed are "start" and "stop" buttons, 2 alternate hide/show buttons (to which I've added on and off speaker icons), to turn sound on or off, and 2 text entry boxes for user input, one to hold (in a variable) the value entered for breaths per minute (default=10) and one to hold the length of the exercise in minutes (default=15).
So, yes, it would be great to be able to reproduce this in RunRev to be web deployed.It is a part of an eLearning lesson on breathing and relaxation to help people improve their health. Being X-platform would allow those with Mac and (hopefully soon) Linux to use the lesson via the webRev plug-in, in addition to Windows users. (My current JavaScript project would only work for Windows since the program it is authored in only has a Windows player available.) So, this would be much more versatile.
I would very much appreciate your help in implementing these features in RunRev.
Thanks, Bernd.
Kind Regards,
saratogacoach
It has been a while since I've posted. Your help last year, as now, is very much appreciated!
Thank you for this example. It will take a little while for me to fully understand the script. My RunRev skills (limited as they were last year) are a little more limited now since I haven't practiced as much as I should have. But, like riding a bicycle, I think once I refresh my memory, I will become more familiaragain with the syntax .
iBreathe is quite impressive! Great design. Yes, quite hypnotic.

My project, written in JavaScript, uses a rectangular bar (112X351 in pixels) which is initially placed 1 pixel below the screen bottom (goes up and down by 350). Here is the primary script from that project which can serve as the basis for a similar RunRev script to duplicate the project in RunRev.
Code: Select all
var time1
function minuteTimer()
{
breakLoop = false
stopLoop = false
fork (calcBreathing)
for (var i=0;i<time1;i++)
{
wait(60)
breakLoop = true
Debug.trace("\n minutes elapsed "+(i+1)+"\n")
}
stopLoop = true
}
function calcBreathing()
{
var bar2 = 60/bar1
for (loop = 0;loop<bar1;loop++)
{
mySound.Play(1,volume)
Vector1.MoveY(-350, bar2*.3)
mySound.Stop()
wait (bar2*.05)
mySound2.Play(1,volume)
Vector1.MoveY(350, bar2*.6)
mySound2.Stop()
wait (bar2*.05)
if (breakLoop) break
}
breakLoop = false
if (bar1 > 6) bar1--
if (!stopLoop) calcBreathing()
The controls needed are "start" and "stop" buttons, 2 alternate hide/show buttons (to which I've added on and off speaker icons), to turn sound on or off, and 2 text entry boxes for user input, one to hold (in a variable) the value entered for breaths per minute (default=10) and one to hold the length of the exercise in minutes (default=15).
So, yes, it would be great to be able to reproduce this in RunRev to be web deployed.It is a part of an eLearning lesson on breathing and relaxation to help people improve their health. Being X-platform would allow those with Mac and (hopefully soon) Linux to use the lesson via the webRev plug-in, in addition to Windows users. (My current JavaScript project would only work for Windows since the program it is authored in only has a Windows player available.) So, this would be much more versatile.
I would very much appreciate your help in implementing these features in RunRev.
Thanks, Bernd.
Kind Regards,
saratogacoach
saratogacoach
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
LiveCode 4.6.0, Windows 7 Home Premium 64 bit, Core i7 2.80, 8G RAM, ATI Radeon HD5770
Re: Basic Animation
Hi Saratogacoach,
have a look at:
as a revlet
http://berndniggemann.on-rev.com/iBreathe/
I would call it a self-controlled-overwater-breathing-apparatus (SCOBA) if it would not offend SCUBA-divers (self-controlled-underwater-breathing-apparatus)
it was fun though.
what do you think? If it works for you I will post the stack.
regards
Bernd
have a look at:
as a revlet
http://berndniggemann.on-rev.com/iBreathe/
I would call it a self-controlled-overwater-breathing-apparatus (SCOBA) if it would not offend SCUBA-divers (self-controlled-underwater-breathing-apparatus)

it was fun though.
what do you think? If it works for you I will post the stack.
regards
Bernd