Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Movie Clip — Gideros Forum

Movie Clip

CyberienceCyberience Member
edited May 2013 in Code snippets
I am trying to use an image, lets say a boat, it slide of in the right direction then it comes back, I can use 2 images, or use scale(-1) on a copy of the one image, in terms of memory, its still using 2 images. when I try to put the -1 in scaleX within the movie clip, the image doesnt flip, so is this possible? and have I got the syntax right?
self:addChild(boatR)
mcBoat=MovieClip.new{
{1,500, 	boatR,{x={-50,(application:getLogicalHeight()),"linear"}}},
{500,1000, 	boatR,{x={(application:getLogicalHeight()),-50,"linear"}}, scaleX={-1,-1} }
}
REAL programmers type copy con filename.exe
---------------------------------------

Comments

  • petecpetec Member
    I haven't tried the sort of syntax you are using but I would imagine that scaleX might just need one value and not the pair you have given.
  • zvardinzvardin Member
    Do you have the anchor point for the image set to the middle?
  • petecpetec Member
    Well, you can scrap my idea! I just tried it and it doesn't work....
  • petecpetec Member
    edited May 2013
    @Cyberience - I've just had a fiddle with the code and could only get it to work if I put the scaleX as a separate command timed to happen at the end of the first move, like this:
    self:addChild(boatR)
    mcBoat=MovieClip.new{
    {1,500, boatR,{x={-50,(application:getLogicalHeight()),"linear"}}},
    {500,501, boatR,{scaleX={1,-1}}}, 
    {500,1000, boatR,{x={(application:getLogicalHeight()),-50,"linear"}} }
    }

    Likes: Cyberience

    +1 -1 (+1 / -0 )Share on Facebook
  • ah, excellent, kind of logical when you find an answer, in effect from 1 to -1 stat in 1 frame. nice solve there mate. Thats really usfull for changing an animation state, without having to have multiple versions of a frame action in both directions :)
    Should post this in a tutorial!

    Thanks
    REAL programmers type copy con filename.exe
    ---------------------------------------
  • petecpetec Member
    You're welcome. It made me play with that type of movement which I hadn't tried before. I got some really gloopy changes of direction by playing with the start and finish frames and the start and finish scales while I was working out what all the numbers did.

    Likes: Cyberience

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.