Animating titlescreen

About Monkey 2 Forums Monkey 2 Programming Help Animating titlescreen

This topic contains 6 replies, has 5 voices, and was last updated by  Gwenel 7 months, 3 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #15321

    Gwenel
    Participant

    What I want is a bit difficult, and hard to explain det but here goes.

    I want to have a button, that appears out of nothing (alpha interpolation) that rotates into the right position. Together it will be one square.

    Each button will be at the corner of the square and rotates into his position clockwise rotation, and the transformation must stop when the square is completed.

    #15322

    therevills
    Participant

    Could you create some screen shots of what you want?

    Sounds like a nice job for tweening.

    #15327

    Gwenel
    Participant

    Let’s see I’m trying to do A slamming effect of two buttons rotating together, like so;

    http://i67.tinypic.com/b9bxc2.png

    #15328

    scurty
    Participant

    This would probably require a shader tbh. Specifically tweening, and a shader.

    #15329

    AdamStrange
    Participant

    break it down
    step 1 – time
    lets assume you want the time for the animations to be 3 seconds = 3000 Millisecs()

    set a time + 3000

    local timeLength:long = 3000
    local timeStart:long = Millisecs()
    local endTime:long = Millisecs() + timeLength

    2 check and convert the time
    in your render

    local time:long = Millisecs()
    if time > startTime and time < endTime then
    local position:float = float(time – startTime) / timeLength
    ‘position will always be in the range 0..1. you can then use this any way you want
    end if

    given a float of 0..1 you can fade in:
    canvas.Alpha = position

    fade out:
    canvas.Alpha = 1.0 – position

    rotate:
    local rotate:float = position * Pi

    etc, etc

    #15330

    Ethernaut
    Participant

    Although this could be done via code, it’s really not the best way in the long term…

    A much better long term solution is adopting an existing animation software like Spine (http://esotericsoftware.com/spine-in-depth), which may be harder initially, but leaves you in a much, much better place eventually, since you’ll be able to bring any kind of transform based 2d animation later – including characters, logos & symbols, effects, etc.

    There was a monkey-x importer, I wonder how much work it would be to port it to Monkey2.

    Cheers.

    #15333

    Gwenel
    Participant

    Thanks, all the advices seemed good so I ended up with creating a mechanical linear movement programatically which is then run through a formula which makes it into a more natural movement. Went abit crazy with trigonometry for the moment so I need to think abit more before I can show anything but it’s getting there, many thanks.

    Also I downloaded and started to teach myself Spine, it looks really good!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.