Jump to content

Austin Spafford

Newbies
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Austin Spafford

  1. Excellent!

    Now the only issue is of defaults, but that's relatively minor. (optimal for me would be if I could start with two garish colors and a 32z32 grid)

    Thank you for the tweak! Since my stab at a hacky-script in CodeLab failed for some bizarre reason, I'm going to go with this plugin. :)

    Extra Credit: Does anyone know why on earth this script would only draw columns?

    (DISCLAIMER: First C# code I've written, and the differences between it and C++ were learned through compiler errors :razz:)

    const int GRID_SIZE = 32;
    
    void Render (Surface dst, Surface src, Rectangle rect) {
    
       bool rowIsToggled    = false;
       int  rowsUntilToggle = 0;
       for (int y = rect.Top; y < rect.Bottom; ++y) {
    
           if (0 == rowsUntilToggle) {
               rowIsToggled    = !rowIsToggled;
               rowsUntilToggle = GRID_SIZE;
           }
    
           bool columnIsToggled    = false;
           int  columnsUntilToggle = 0;
           for (int x = rect.Left; x < rect.Right; ++x) {
    
               if (0 == columnsUntilToggle) {
                   columnIsToggled    = !columnIsToggled;
                   columnsUntilToggle = GRID_SIZE;
               }
    
               ColorBgra color;
               if (rowIsToggled != columnIsToggled)
                   color = ColorBgra.FromBgr(220, 20, 20);
               else
                   color = ColorBgra.FromBgr(20, 20, 220);
    
               dst[x, y] = color;
    
               --columnsUntilToggle;
           }
    
           --rowsUntilToggle;
       }
    
    }

    This is going to make manipulating icon artwork a lot more convenient at work.

    Thank you!

    -Austin Spafford

×
×
  • Create New...