StartAnimator upgrade

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

User avatar
Posts: 319
Joined: Sat Feb 15, 2014 9:54 am

StartAnimator upgrade

Postby rrTea » Sun Apr 12, 2015 9:04 am

By now it's obvious I really like to use simple components like RenderBeams and Animators :)

So... I'd find it useful if the "StartAnimator" would evolve into something like an "AnimatorController" with options for Start / Stop / Pause / Reset. For example if I wanted to have an Animator work only under certain circumstances, I'd wrap it in a Condition, like this (maybe there's a better way to go about it?):

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" ClearColor="0.7509 0.9651 0.6902 0" FrameRateStyle="2" FixedFrameRate="30" NoSound="1">
    <ZExpression Expression="TransformerOperator.AutoStart = 0;"/>
    <KeyPress Keys=" " RepeatDelay="0.1">
//TransformerOperator.AutoStart = abs(TransformerOperator.AutoStart-1);

TransformerOperator.AutoStart = TransformerOperator.AutoStart ? 0 : 1;

//This is just to visually confirm
//something's happening
App.ClearColor.G = 0.5+rnd()/2f;
App.ClearColor.B = 0.5+rnd()/2f;]]>
    <Condition Expression="return TransformerOperator.AutoStart;">
        <AnimatorSimple Name="TransformerOperator" Duration="0.25" Target="App.ClearColor.R" AutoReverse="255" RepeatCount="-1" ToValue="1"/>

(press space to toggle the animation on/off)
but this looks a bit "noisy" to me - the whole Condition component could be cut out from the Project Tree if instead of a ZExpression I could just set a "Pause" on or off under KeyPress / OnPressed.

Admittedly it works even as is, but it'd be clearer to work with if StartAnimator had these options.

Posts: 196
Joined: Sun Feb 09, 2014 4:42 pm

Postby Imerion » Tue Apr 14, 2015 8:46 am

Sounds smart! As I often use these myself too, a simple way to do :

MySimpleAnimator.Pause = 0;
MySimpleAnimator.Pause = 1;

To start and stop playback of animation would be nice!

Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 1 guest