Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey! Sorry about that it was just a mistake of mine actually. On another note, I have a question : how do you make a menu scale down to disappear. I understand it's by using using the tween function, and it works greatly for scaling up, but for some reasons when I try to scale down it instantly goes to the desired size and do a scale up to go in the previous size.

Here's some of my code : 

//Create
box_width = 1000 
box_height = 200  
og_width = box_width/2 
og_height = box_height/2
flex = new AutoUiFlexContainer(AuiDirection.vertical,og_width,og_height,AuiDrawAnchor.MIDCENTER); 
flex.set_spacing(14) 
flex.set_nine_slice_sprite(spr_black_textbox) 
flex.set_padding(100,100,100,100) 
flex.set_tween(true,true,true,true) 
flex.reset_lerp_target(1,0) 
flex.tween_type = AuiTweenType.EaseInOutExpo 
flex.tween_speed = 0.05
//Alarm 1 To scale up
flex.tween_width = box_width  
flex.tween_height = box_height
//Alarm 2 To scale down
flex.set_tween(true,true,true,true,function() {         
    //audio_play_sound(snd_clap,1,false)         
    obj_ui_textbox.flex.set_nine_slice_sprite(spr_blank)         
    obj_ui_textbox.state = 0         
    with obj_ui_textbox alarm_set(4,30)    
})
flex.reset_lerp_target(1,0) 
flex.tween_width = 1 
flex.tween_height = 1

No problem!  

On your return tween, set reset_lerp_target(0, 1).  Right now you set (1,0) once in create and once in the alarm.

thanks for the response! hmmm if I do that the menu just pops out immediately. If I use set_force_width and set_force_height instead of changing the tween_width and tween_height values for the return tween, I can see the animation play but the menu is at a different position for some reasons, more at the bottom at a higher Y... Any idea what could be causing this?

Figured it out!  It's an error on my end, but to fix it you can just call reset_lerp_target(0, 0.99)

Thank youu!! Works perfectly now :)

I'm loving it btw, it's very nice to work with, thank you for your work!

Glad you like it!