Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Arguments (in the form of a table):
- `awestore_compat`: make api even *more* similar to awestore's (def. `false`)
- `log`: it would print additional logs, but there aren't any logs to print right now so it kinda just sits there (def. `false`)
- `debug`: basically just tags the timed instance. I use it in tandem with `manager.timed.override.forall`
- `init`: when `true`, executes `subscribed` function one time initially with the initial `pos` of the animation

All of these values (except awestore_compat and subscribed) are mutable and changing them will change how the animation looks. I do not suggest changing `pos`, however, unless you change the position of what's going to be animated in some other way

Expand Down
4 changes: 3 additions & 1 deletion timed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ local function timed(args)
function obj:fire(...) args = ({...})[1] and {...} or {obj.pos, obj._time, obj._dx}; for _, func in pairs(obj._subscribed) do func(unpack(args)) end end

--subscribe stuff initially and add callback
obj.subscribe_callback = function(func) func(obj.pos, obj._time, obj._dt) end
if args.init then
obj.subscribe_callback = function(func) func(obj.pos, obj._time, obj._dt) end
end
if args.subscribed ~= nil then obj:subscribe(args.subscribed) end

-- Metatable for cooler api
Expand Down