About Monkey 2 › Forums › Monkey 2 Programming Help › Animating titlescreen
Tagged: GUI option screen button
This topic contains 6 replies, has 5 voices, and was last updated by
Gwenel
7 months, 3 weeks ago.
-
AuthorPosts
-
August 24, 2018 at 11:16 pm #15321
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.
August 25, 2018 at 4:15 am #15322Could you create some screen shots of what you want?
Sounds like a nice job for tweening.
August 25, 2018 at 2:55 pm #15327Let’s see I’m trying to do A slamming effect of two buttons rotating together, like so;
http://i67.tinypic.com/b9bxc2.png
August 26, 2018 at 4:37 am #15328This would probably require a shader tbh. Specifically tweening, and a shader.
August 26, 2018 at 7:56 am #15329break 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() + timeLength2 check and convert the time
in your renderlocal 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 ifgiven a float of 0..1 you can fade in:
canvas.Alpha = positionfade out:
canvas.Alpha = 1.0 – positionrotate:
local rotate:float = position * Pietc, etc
August 26, 2018 at 8:06 am #15330Although 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.
August 27, 2018 at 8:50 am #15333Thanks, 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!
-
AuthorPosts
You must be logged in to reply to this topic.