From f6510f6a42f44d830bb60db6354067768494d8ca Mon Sep 17 00:00:00 2001 From: GryphonClaw Date: Mon, 20 May 2024 15:08:14 -0700 Subject: [PATCH 1/2] Update index.txt Fixed typo in a code sample. --- docs/index.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.txt b/docs/index.txt index d1887f18..c2860679 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -1918,7 +1918,7 @@ Instead of manually defining the properties, you can represent a sprite using th # anything you want to represent as a sprite attr_sprite - def initialize(x: 0, y: 0, w: 0, h: 0k + def initialize(x: 0, y: 0, w: 0, h: 0) @x = x @y = y @w = w From 1d57f067afcebe24169aaa82ed07c1a6c6855189 Mon Sep 17 00:00:00 2001 From: GryphonClaw Date: Tue, 22 Oct 2024 12:32:47 -0700 Subject: [PATCH 2/2] layout.rb - added custom color to debug_primitives Added custom color option to debug_primitves function. if the color is provided, it checks to see if invert_colors is false then assigns the passed custom_color to the function's color value. --- dragon/layout.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dragon/layout.rb b/dragon/layout.rb index 01e8376c..0b2800f7 100644 --- a/dragon/layout.rb +++ b/dragon/layout.rb @@ -663,13 +663,17 @@ def __debug_primitives__(color:) __debug_primitives_seperators__ end - def debug_primitives(invert_colors: false) + def debug_primitives(invert_colors: false, custom_color: nil) color = if invert_colors { r: 255, g: 255, b: 255 } else { r: 0, g: 0, b: 0 } end - + + if cusomt_color && !invert_colors + color = custom_color + end + @debug_primitives_colors ||= color if @debug_primitives_colors != color