Skip to content

Instantly share code, notes, and snippets.

@amirrajan
Created February 8, 2026 23:31
Show Gist options
  • Select an option

  • Save amirrajan/807fbddfa8e3e84f7ff5737a32b618e0 to your computer and use it in GitHub Desktop.

Select an option

Save amirrajan/807fbddfa8e3e84f7ff5737a32b618e0 to your computer and use it in GitHub Desktop.
DragonRuby Game Toolkit: render order demonstration
def tick args
# comment out each of these label options one at a time to see how it renders
args.outputs.labels << { x: 640,
y: Math.sin(Kernel.tick_count.to_radians).abs * 720,
r: 255, g: 0, b: 0,
text: "I will always be on top (regardless of position in the tick method)",
anchor_x: 0.5,
anchor_y: 0.5 }
# comment out each of these label options one at a time to see how it renders
# args.outputs.primitives << { x: 640,
# y: Math.sin(Kernel.tick_count.to_radians).abs * 720,
# r: 255, g: 0, b: 0,
# text: "I will render below the :solid",
# anchor_x: 0.5,
# anchor_y: 0.5 }
args.outputs.primitives << { x: 640,
y: 360,
w: 100,
h: 720,
path: :solid,
r: 0,
g: 0,
b: 0,
a: 255,
anchor_x: 0.5,
anchor_y: 0.5 }
# comment out each of these label options one at a time to see how it renders
# args.outputs.primitives << { x: 640,
# y: Math.sin(Kernel.tick_count.to_radians).abs * 720,
# r: 255, g: 0, b: 0,
# text: "I will render above the :solid",
# anchor_x: 0.5,
# anchor_y: 0.5 }
# comment out each of these label options one at a time to see how it renders
# args.outputs.labels << { x: 640,
# y: Math.sin(Kernel.tick_count.to_radians).abs * 720,
# r: 255, g: 0, b: 0,
# text: "I will always be on top (regardless of position in the tick method)",
# anchor_x: 0.5,
# anchor_y: 0.5 }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment