Rick Posted March 8, 2015 Share Posted March 8, 2015 Found a cool lua tweening library so thought I'd share it https://github.com/kikito/tween.lua 5 Quote Link to comment Share on other sites More sharing options...
dennis Posted March 10, 2015 Share Posted March 10, 2015 so it does create a smooth tween transition for creating motions Quote Link to comment Share on other sites More sharing options...
Rick Posted March 10, 2015 Author Share Posted March 10, 2015 Yeah. To explain the below on how it's used. You have some lua table (music in this case) that can have whatever you want in it. You then create the tween object (which you need to hang onto because you need to call it's update function each frame) passing in how long you want the entire tween to take (10 in this case(note this isn't seconds but it's a value that will always be the same depending on what you pass into the update function for timing)), then pass in the lua table that it's going to modify (music in this case), and then pass in a table that has the same property name as the table has that you want modified (volume in this case) and the end value (5 in this case). -- increase the volume of music from 0 to 5 in 10 seconds local music = { volume = 0, path = "path/to/file.mp3" } local musicTween = tween.new(10, music, {volume = 5}) ... musicTween:update(dt) So it knows to adjust the volume setting in the music table to a max value of 5 over time 10 duration. 2 Quote Link to comment Share on other sites More sharing options...
dennis Posted March 10, 2015 Share Posted March 10, 2015 wow, sounds very usefull!! kudos man ! Quote Link to comment Share on other sites More sharing options...
Rick Posted March 10, 2015 Author Share Posted March 10, 2015 I didn't make it just found it and thought I'd share Quote Link to comment Share on other sites More sharing options...
dennis Posted March 10, 2015 Share Posted March 10, 2015 I didn't make it just found it and thought I'd share haha, I know because you mentioned but still kudos, at least for sharing Quote Link to comment Share on other sites More sharing options...
Vaelek Posted March 16, 2015 Share Posted March 16, 2015 Posts like this I think should have a special section on the forum. Anything that offers helpful information, tips, tricks, etc. There is a lot of this kind of stuff strewn across multiple sections between all the questions that are nice for those that regularly keep up on the forums, but that newcomers may never stumble across, or that even those that saw them may lose once they get buried under dozens of other topics. Or if not a dedicated section, perhaps a stickied thread that is actively updated serving the only purpose of indexing and linking to threads such as this. 3 Quote Link to comment Share on other sites More sharing options...
Rick Posted March 16, 2015 Author Share Posted March 16, 2015 Yeah Josh is anti-sticky for some reason. I'm not exactly sure why. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.