nicopap / cuicui_layout

The dumbest and simplest layouting algorithm for bevy
40 stars 2 forks source link

Chirp `fn` statements #80

Closed nicopap closed 1 year ago

nicopap commented 1 year ago

We'd like a way to define "templates" to re-use while allowing a variable.

We could re-use the rust fn syntax as follow:

fn template_name(arg_1, arg_2, …) {
  TemplateUiRoot(row) {
    TemplateUiImage(ui("image.png") width(arg_1) color(arg_2))
  }
}

Then, such a template could be inserted inline with a use statement:

use template_name(100%, coral)

The template would be a simple "find and replace". The only data type would be String (and tuples of strings). Which is already superior to bash.

nicopap commented 1 year ago

Completed with 0.10