Push dev work to master #2
|
@ -243,12 +243,15 @@ intval.setDir = function (val = true) {
|
|||
return log.warn('Direction must be represented as either true or false')
|
||||
}
|
||||
intval._state.dir = val
|
||||
log.info('setDir', { direction : dir ? 'forward' : 'backward' })
|
||||
}
|
||||
intval.setTime = function (val = 0) {
|
||||
intval._state.frame.time = val
|
||||
log.info('setTime', { time : val })
|
||||
}
|
||||
intval.setDelay = function (val = 0) {
|
||||
intval._state.frame.delay = val
|
||||
log.info('setDelay', { delay : val })
|
||||
}
|
||||
/**
|
||||
* Begin a single frame with set variables or defaults
|
||||
|
@ -284,9 +287,9 @@ intval.frame = function (dir = null, time = null) {
|
|||
if (time !== null && time !== 0) {
|
||||
setTimeout(intval._pause, intval._state.frame.open)
|
||||
if (dir) {
|
||||
setTimeout(intval._startFwd, 1000)
|
||||
setTimeout(intval._startFwd, (time - intval._state.frame.open))
|
||||
} else {
|
||||
setTimeout(intval._startBwd, 1000)
|
||||
setTimeout(intval._startBwd, (time - intval._state.frame.open))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,4 +4,4 @@ const intval = require('../lib/intval')
|
|||
|
||||
intval.init()
|
||||
|
||||
intval.setTime(1000)
|
||||
intval.setTime(5000)
|
Loading…
Reference in New Issue