samples/01_rendering_basics/02_lines/app/main.rb
# This would create a line from (100, 100) to (300, 300)
# The RGB code (255, 0, 255) would determine its color, a purple
# It would have an Alpha value of 255, making it completely opaque
This would create a line from (100, 100) to (300, 300)
The RGB code (255, 0, 255) would determine its color, a purple
It would have an Alpha value of 255, making it completely opaque
This would create a line from ( 100 100 ) to ( 300 300 ) The RGB code ( 255 0 255 ) would determine its color a purple It would have an Alpha value of 255 making it completely opaque
def tick args
  tick_instructions args, "Sample app shows how to create lines."
  args.outputs.labels << [480, 620, "Lines (x, y, x2, y2, r, g, b, a)"]
  args.outputs.lines  << [380, 450, 675, 450]
  args.outputs.lines  << [380, 410, 875, 410]
  args.outputs.lines  << [380, 370, 875, 370, args.state.tick_count % 255, 0, 0, 255]
  args.outputs.lines  << [380, 330 - args.state.tick_count % 25, 875, 330, 0, 0, 0, 255]
  args.outputs.lines  << [380 + args.state.tick_count % 400, 290, 875, 290, 0, 0, 0, 255]
end
def tick args tick_instructions args , "Sample app shows how to create lines." args . outputs . labels << [ 480 , 620 , "Lines (x, y, x2, y2, r, g, b, a)" ] args . outputs . lines << [ 380 , 450 , 675 , 450 ] args . outputs . lines << [ 380 , 410 , 875 , 410 ] args . outputs . lines << [ 380 , 370 , 875 , 370 , args . state . tick_count % 255 , 0 , 0 , 255 ] args . outputs . lines << [ 380 , 330 - args . state . tick_count % 25 , 875 , 330 , 0 , 0 , 0 , 255 ] args . outputs . lines << [ 380 + args . state . tick_count % 400 , 290 , 875 , 290 , 0 , 0 , 0 , 255 ] end
This would create a line from (100, 100) to (300, 300)
The RGB code (255, 0, 255) would determine its color, a purple
It would have an Alpha value of 255, making it completely opaque
This would create a line from ( 100 100 ) to ( 300 300 ) The RGB code ( 255 0 255 ) would determine its color a purple It would have an Alpha value of 255 making it completely opaque
# Some simple lines # These examples utilize args.state.tick_count to change the length of the lines over time # args.state.tick_count is the ticks that have occurred in the game # This is accomplished by making either the starting or ending point based on the args.state.tick_count
args