tweening
This commit is contained in:
parent
ef811a9174
commit
8bbf710a5c
27
startmenu.js
27
startmenu.js
|
@ -11,7 +11,6 @@ var exitgame = function()
|
|||
quit();
|
||||
};
|
||||
|
||||
|
||||
var colorshifter = {
|
||||
color: Color.green,
|
||||
font_size: 1,
|
||||
|
@ -30,14 +29,36 @@ var options = GUI.column({
|
|||
hovered: {},
|
||||
});
|
||||
|
||||
options.tt = Tween.start(options, 'hovered', colorshifter, colorshiftend, {time: 0.25, loop: "yoyo", ease: Ease.sine.out});
|
||||
options.tt = Tween.start(options, 'hovered', [colorshifter, colorshiftend], {time: 0.35, loop: "restart", whole: false, ease: Ease.quint.out});
|
||||
|
||||
var rainbowchain = [
|
||||
[255,0,0,255],
|
||||
[255,255,0,255],
|
||||
[0,255,0,255],
|
||||
[0,255,255,255],
|
||||
[0,0,255,255],
|
||||
[255,0,255,255],
|
||||
];
|
||||
|
||||
//Tween.start(options.hovered, 'color', rainbowchain, {time: 4, loop: "circle", whole: true});
|
||||
|
||||
var idx = 0;
|
||||
var item = options.items[idx];
|
||||
item.selected = true;
|
||||
|
||||
var menuopts = {
|
||||
superpos: [0,0],
|
||||
};
|
||||
|
||||
Tween.start(menuopts, 'superpos', [Window.dimensions.scale([0.4,0.9]), Window.dimensions.scale([0.6,0.9])], {
|
||||
time: 1,
|
||||
loop: "circle",
|
||||
whole: false,
|
||||
ease: Ease.cubic.inout
|
||||
});
|
||||
|
||||
function startmenu() {
|
||||
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(Window.dimensions.scale([0.5,0.9]));
|
||||
GUI.text_fn("SUPER BREAKOUT", {font_size:6, anchor: [0.5,0.5]}).draw(menuopts.superpos);
|
||||
|
||||
options.draw(Window.dimensions.scale([0.5,0.5]).add([-25,0]));
|
||||
|
||||
|
|
Loading…
Reference in a new issue