Skip to content

Instantly share code, notes, and snippets.

@KonnorRogers
Last active June 30, 2025 06:12
Show Gist options
  • Save KonnorRogers/9ac0b29a9d738d89931a439a57844c80 to your computer and use it in GitHub Desktop.
Save KonnorRogers/9ac0b29a9d738d89931a439a57844c80 to your computer and use it in GitHub Desktop.
dest-out DR gist
def tick(args)
max_w = args.grid.w
max_h = args.grid.h
box_y = max_h / 4
box_w = (args.grid.w / 3) - 4
box_h = max_h / 2
border_thickness = 2
borders = [
# TOP
{
x: 0,
y: max_h - border_thickness,
h: border_thickness,
w: max_w,
primitive_marker: :border
},
# Right
{
x: max_w - border_thickness,
y: 0,
h: max_h,
w: border_thickness,
primitive_marker: :border
},
# BOTTOM
{
x: 0,
y: 0,
h: border_thickness,
w: max_w,
primitive_marker: :border
},
# LEFT
{
x: 0,
y: 0,
h: max_h,
w: 2,
primitive_marker: :border
}
]
source_rect_w = (args.grid.w / 3 * 2)
source_rect = {
x: args.grid.w - source_rect_w,
w: source_rect_w,
h: (args.grid.h / 3 * 2),
y: 0,
r: 0,
b: 255,
g: 0,
a: 255,
primitive_marker: :solid
}
source_box_rt = {
x: border_thickness,
y: box_y,
h: box_h,
w: box_w,
path: :source_box
}
dest_rect_w = (args.grid.w / 3 * 2)
dest_rect_h = (args.grid.h / 3 * 2)
dest_rect = {
x: border_thickness,
w: dest_rect_w,
h: dest_rect_h,
y: args.grid.h - dest_rect_h - border_thickness,
r: 238,
g: 210,
b: 2,
a: 255,
primitive_marker: :solid,
}
dest_box_rt = {
x: (source_box_rt.x + source_box_rt.w + 4).ceil,
y: box_y,
h: box_h,
w: box_w,
path: :dest_box
}
final_rect_w = (args.grid.w / 3 * 2)
final_rect = {
x: args.grid.w - final_rect_w,
w: final_rect_w,
h: (args.grid.h / 3 * 2),
y: 0,
r: 0,
b: 255,
g: 0,
a: 255,
primitive_marker: :solid
}
final_box_rt = {
x: (dest_box_rt.x + dest_box_rt.w + 4).ceil,
y: box_y,
h: box_h,
w: box_w,
path: :final_box
}
args.outputs[:source_box].background_color = [255, 255, 255, 255]
args.outputs[:dest_box].background_color = [255, 255, 255, 255]
args.outputs[:final_box].background_color = [255, 255, 255, 255]
args.outputs[:source_box].primitives.concat(borders).concat([source_rect])
args.outputs[:dest_box].primitives.concat(borders).concat([dest_rect])
args.outputs[:final_box].primitives.concat(borders).concat([
dest_rect,
source_rect.merge({ r: 255, b: 255, g: 255, a: 255, blendmode_enum: 2, })
])
args.outputs << [
source_box_rt,
dest_box_rt,
final_box_rt,
]
end
$gtk.reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment