Actions

Proposed badgecode2: Difference between revisions

From Convention Master Documentation

No edit summary
No edit summary
Line 11: Line 11:
badgecode2 when possible should match the syntax and function names of badgecode, alternatively the following system is proposed.
badgecode2 when possible should match the syntax and function names of badgecode, alternatively the following system is proposed.


for complex calls:
==== Complex calls: ====
 


generally x and y should be replaced with top= and left= a second x and y string would be replaced with bottom= and right=
generally x and y should be replaced with top= and left= a second x and y string would be replaced with bottom= and right=


function_name(top=1,left=1, optional arguments) (a function like draw_box and draw_line would also have bottom= and right= as required args, draw_image optionally would use this as well)
<nowiki>function_name(top=1,left=1, optional arguments)</nowiki> (a function like draw_box and draw_line would also have bottom= and right= as required args, draw_image optionally would use this as well)


function name (value,value,value,value) (this is used for simple functions that only need to take color values (or other number values) and apply to the whole image.
=== Simple Calls: ===
<nowiki>function_name(value,value,value,value)</nowiki> (this is used for simple functions that only need to take color values (or other number values) and apply to the whole image.


=== Language Features ===
=== Language Features ===

Revision as of 22:24, 26 July 2021

badgecode2

General Design Philosphy

badgecode2 should overcome the limitations with the existing design, allowing us to match combinations of charcteristics to swap out drawing commands.

badgecode2 should rely on sysvars over special logic functions to match things in the system, using an extensive system of flags and strings to create badges.

badgecode2 should reduce the number of potential ways to address the image space, currently we support.. percentages, inches, cm, mm, points, and pixels - it is suggested that this be reduced to percentages and pixels for images, and pixels and points for fonts, with the default mode for fonts being assumed to be in points.

badgecode2 when possible should match the syntax and function names of badgecode, alternatively the following system is proposed.

Complex calls:

generally x and y should be replaced with top= and left= a second x and y string would be replaced with bottom= and right=

function_name(top=1,left=1, optional arguments) (a function like draw_box and draw_line would also have bottom= and right= as required args, draw_image optionally would use this as well)

Simple Calls:

function_name(value,value,value,value) (this is used for simple functions that only need to take color values (or other number values) and apply to the whole image.

Language Features

  • Logic Features
  • full if/elseif/else support
  • Switch support
  • Comparison and/or Logical Operators (likely just one of these is enough)

Convivence Features

  • Local Variables - useful when bringing templated badge into a system. All UDF's can be patched to a named variable in the badgecode.

Wishlist Advanced Features

  • php-gd passthru - a special function call to allow us to call any function within php-gd.

Drawing, Text and Image Options

  • Everything that badgecode currently supports.