arrange-animate objects vertically/horizontally#490
Open
ArbitRandomUser wants to merge 30 commits intoJuliaAnimators:mainfrom
Open
arrange-animate objects vertically/horizontally#490ArbitRandomUser wants to merge 30 commits intoJuliaAnimators:mainfrom
ArbitRandomUser wants to merge 30 commits intoJuliaAnimators:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #490 +/- ##
==========================================
- Coverage 77.74% 77.28% -0.47%
==========================================
Files 38 40 +2
Lines 1991 2210 +219
==========================================
+ Hits 1548 1708 +160
- Misses 443 502 +59
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Sov-trotter
reviewed
Aug 21, 2022
src/arrange.jl
Outdated
|
|
||
|
|
||
| """ | ||
| arrange() |
Member
There was a problem hiding this comment.
You can add the parameters here
Sov-trotter
reviewed
Aug 21, 2022
Contributor
Author
|
@Sov-trotter @Wikunia @gpucce @TheCedarPrince using Javis
video = Video(1000,1000)
nframes=250
groundj = Background(1:nframes,(args...) -> begin
background("black")
sethue("white")
end)
objj1 = Object(1:nframes,(args...)-> begin
box(O,100,100,:stroke)
return O
end,
Point(100,150)
)
objj2 = Object(1:nframes,(args...)-> begin
circle(O,50,:stroke)
return O
end,
Point(-100,250)
)
objj3 = Object(1:nframes,(args...)-> begin
#rotate(2π/12)
box(O,100,50,:stroke)
#star(O,50,3,0.5,0.0,:stroke)
return O
end,
Point(-200,-150)
)
objlist = [objj1,objj2,objj3]
frameno = 2
Object(1:nframes,(args...)->circle(O,5,:fill))
#act!(frameno,arrange(frameno:frameno+25,objlist,O;gap=0,dir=:horizontal,align=:left,towards=:top))
for dir in (:horizontal,:vertical)
global frameno
for align in (:left,:right)
for towards in (:top,:bottom)
act!(frameno,arrange(frameno:frameno+25,objlist,O;gap=0,dir=dir,align=align,towards=towards))
frameno=frameno+30
end
end
end
render(video,pathname="testarrange3.gif")
run(`mpv testarrange3.gif`)
|
Sov-trotter
reviewed
Sep 5, 2022
| # clear all CURRENT_* constants to not accidentally use a previous video when creating a new one | ||
| empty_CURRENT_constants() | ||
| haskey(video.defs, :RuntimeFunctionDict) ? empty!(video.defs[:RuntimeFunctionDict]) : | ||
| nothing |
Member
There was a problem hiding this comment.
This can go in the same line above I guess. But if it's the output of JuliaFormatter then fell free to resolve.
Sov-trotter
reviewed
Sep 5, 2022
src/runtimefuncs.jl
Outdated
| at render time RuntimeFunctionMap[frame] is checked and every Func | ||
| in the array is called with `func(frame)` | ||
| """ | ||
| #videoRuntimeFunctionDict = Dict{Int,Array{Function}}() |
Contributor
Author
|
P.R also adds ability to arrange around objects now using Javis
video = Video(1000,1000)
nframes=300
groundj = Background(1:nframes,(args...) -> begin
background("black")
sethue("white")
end)
objj1 = Object(1:nframes,(args...)-> begin
sethue("yellow")
box(O,100,100,:stroke)
text("Target")
return O
end,
O-100
)
objj2 = Object(1:nframes,(args...)-> begin
circle(O,35,:stroke)
return O
end,
Point(-100,250)
)
objj3 = Object(1:nframes,(args...)-> begin
#rotate(2π/12)
box(O,150,50,:stroke)
#star(O,50,3,0.5,0.0,:stroke)
return O
end,
Point(-200,-150)
)
objlist = [objj2,objj3]
frameno = 20
for dir in (:horizontal,:vertical)
global frameno
for halign in (:left,:right)
for valign in (:top,:bottom)
act!(frameno,arrange(frameno:frameno+25,objlist,objj1;gap=0,dir=dir,halign=halign,valign=valign))
frameno=frameno+30
end
end
end
render(video,pathname="testarrange_obj.gif")
run(`mpv testarrange_obj.gif`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


PR Checklist
If you are contributing to
Javis.jl, please make sure you are able to check off each item on this list:CHANGELOG.mdwith whatever changes/features I added with this PR?Project.toml+ set an upper bound of the dependency (if applicable)?testdirectory (if applicable)?Link to relevant issue(s)
Closes #
How did you address these issues with this PR? What methods did you use?
P.R allows objects to be arranged around other objects or a point
example