4 ms·
Drawing an ellipse: ⟨⟨white, black⟩⇐color⟩←r←•Import "../../raylib.bqn" PerFrame ← { pos ← r.mouse.GetPos@ q←∾˘˘⟜⌽1‿¯1-⊸≍⊸×|0‿100- #
by surprisetalk 3y ago
Drawing an ellipse:
⟨⟨white, black⟩⇐color⟩←r←•Import "../../raylib.bqn"
PerFrame ← {
pos ← r.mouse.GetPos@
q←∾˘˘⟜⌽1‿¯1-⊸≍⊸×|0‿100- # Morphing
s←⍉˘⍉⁼∾˘˘˝q⊸+˘⍷⌽˘⊸∾100×0∾˘¬↕3 # duping
(white r.draw.EllipseOutline pos⊸+˘)˘s # moving + drawing
poses ← [pos,400‿300,300‿300]
white r.draw.Triangle poses
100|+1
}r.draw._withCanvas_ black
r.window.SetSize 0.5
PerFrame•_While_(¬r.window.ShouldClose)∘0 r.window._openAs "Hello!!!"
[1] https://github.com/Brian-ED/rayed-bqn/tree/master/examples https://github.com/Brian-ED/rayed-bqn/tree/master/examples
- Brian-E 3y agoIt's a lovely example of the tersness of BQN, it draws an animation of 10 ellipses animating into eachother, along with a triangle for fun. if you just want to draw one ellipse, i made this program ⟨⟨white, black⟩⇐color⟩←r←•Import "../../raylib.bqn" PerFrame ← white r.draw.EllipseOutline 100‿100≍300‿200˙ Screen ← PerFrame r.draw._withCanvas_ black Screen •_While_(¬r.window.ShouldClose) r.window._openAs "Hello!!!" first line is imports, second draws ellipse, third draws the ellipse on a black background, forth opens the window with a close condition :)