Skip to content

Gryphon claw debug primitives custom color #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions dragon/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down