samples/99_genre_arcade/sound_golf/app/main.rb
def piano_button args, note, position
  args.state.new_entity(:button) do |b| # declares button as new entity
    b.label  =  [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] # label definition
    b.border =  { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } # border definition, text/title; 20 subtracted so label is in center of border
  end
end
# Creates buttons for each note, and sets a label (the note's name) and border for each note's button.
Creates buttons for each note, and sets a label (the note's name) and border for each note's button.
Creates buttons for each note and sets a label ( the note ' s name ) and border for each note ' s button .
def piano_button args, note, position
  args.state.new_entity(:button) do |b| 
    b.label  =  [460 + 40.mult(position), args.grid.h * 0.4, "#{note}", 0, 1, 0, 0, 0] 
    b.border =  { x: 460 + 40.mult(position) - 20, y: args.grid.h * 0.4 - 32, w: 40, h: 40, label: note } 
  end
end
def piano_button args , note , position args . state . new_entity ( :button ) do | b | b . label = [ 460 + 40 . mult ( position ) , args . grid . h * 0.4 , "#{note}" , 0 , 1 , 0 , 0 , 0 ] b . border = { x : 460 + 40 . mult ( position ) - 20 , y : args . grid . h * 0.4 - 32 , w : 40 , h : 40 , label : note } end end
Creates buttons for each note, and sets a label (the note's name) and border for each note's button.
Creates buttons for each note and sets a label ( the note ' s name ) and border for each note ' s button .
# declares button as new entity # label definition # border definition, text/title; 20 subtracted so label is in center of border
args
note
position