samples/07_advanced_rendering/03_render_target_viewports/app/main.rb
def new_button_prefab x, y, message
    w, h = 300, 50
    button        = state.new_entity(:button_with_fade)
    button.label  = [x + w.half, y + h.half + 10, message, 0, 1] # '+ 10' keeps label's text within button's borders
    button.border = [x, y, w, h] # sets border definition
    button
  end
# Creates a new button by declaring it as a new entity, and sets values.
Creates a new button by declaring it as a new entity, and sets values.
Creates a new button by declaring it as a new entity and sets values .
def new_button_prefab x, y, message
    w, h = 300, 50
    button        = state.new_entity(:button_with_fade)
    button.label  = [x + w.half, y + h.half + 10, message, 0, 1] 
    button.border = [x, y, w, h] 
    button
  end
def new_button_prefab x , y , message w , h = 300 , 50 button = state . new_entity ( :button_with_fade ) button . label = [ x + w . half , y + h . half + 10 , message , 0 , 1 ] button . border = [ x , y , w , h ] button end
Creates a new button by declaring it as a new entity, and sets values.
Creates a new button by declaring it as a new entity and sets values .
# '+ 10' keeps label's text within button's borders # sets border definition
x
y
message