-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlxSound: add loopTime, closes #1662 #1736
Conversation
…bled. Also, tiny cleanup of some FlxSound things.
/** | ||
* In case of looping, from where to restart the sound when it loops back | ||
*/ | ||
private var loopPoint(default, set):Float; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be public
(otherwise what's the point of making it a property with a setter?) and declared after looping
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not sure I like the name... How about loopTime
(there already is a time
) or loopPosition
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally it was loopPosition, I changed it because, well, we already have a Position too :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loopTime
probably makes the most sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure honestly... But you can decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the connection to the already existing time
property seems sensible.
@@ -79,8 +79,9 @@ class SoundFrontEnd | |||
* @param Volume How loud the sound should be, from 0 to 1. | |||
* @param Looped Whether to loop this music. | |||
* @param Group The group to add this sound to. | |||
* @param LoopPoint Point at which the sound will restart when looping back (in case of looping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be LoopTime
… second argument of sound.play() instead), now the event is always used. Fixed naming
I have fixed the possibility of looping using the second argument of Sound.play(), now we always use the event. In native builds has 0 effect on performance, not sure about flash, although it leads to nicer code. |
Thanks! |
FlxSound: add loopTime, closes #1662
Also, tiny cleanup of some FlxSound things.
Related for example to request #1662