Golly: Filling selection with a color

For general discussion about Conway's Game of Life.
Post Reply
Lode
Posts: 14
Joined: November 26th, 2014, 8:12 am

Golly: Filling selection with a color

Post by Lode »

Hi,

When editing patterns in Golly (of a CA with more than two states), is there a way to fill the current selection with the current color?

There is a "clear" that makes it black and a "random fill" that fills it with random colors, but what about just filling it with one non-black color?

Thanks.
User avatar
codeholic
Moderator
Posts: 1174
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Golly: Filling selection with a color

Post by codeholic »

There is a change-state.py script. It's not very convenient, because one has to switch to the keyboard, but good enough.
Ivan Fomichev
Lode
Posts: 14
Joined: November 26th, 2014, 8:12 am

Re: Golly: Filling selection with a color

Post by Lode »

I see, thanks.

If I could have some suggestions for making the awesome Golly even more awesome, it would be:

-more/improved editing tools:
--fill selection with single color (as mentioned above :)) - an alternative is of course simply a rectangle drawing tool
--a FAST floodfill (the python one takes MINUTES to floodfill a small area...)
--draw line (e.g. using the pen tool with shift or ctrl click to draw line from previous point to here)
--a way to lock vertical or horizontal direction, so that you can draw straight lines (wires in wireworld, ...) easily
--pen tool that is larger than 1 pixel
--move selection content by dragging it (ctrl+x then ctrl+v is very awkward, especially because sometimes it mysteriously doesn't work or crashes)
--swap/replace colors in selection
--assign a second color to the right mouse button

-a save function that saves the file without any dialogs. Currently saving is a nightmare: every single time you save, it shows the file dialog, and then asks "do you want to overwrite the file". Normally that is what a "Save As..." does. This program is missing a "Save"

Thanks!

EDIT: not sure if change-state.py does what I want, it looks like it changes from one color to another, so wouldn't fill any rectangle fully with the selected color, but I think I can make my own script :)
User avatar
codeholic
Moderator
Posts: 1174
Joined: September 13th, 2011, 8:23 am
Location: Hamburg, Germany

Re: Golly: Filling selection with a color

Post by codeholic »

Lode wrote:EDIT: not sure if change-state.py does what I want, it looks like it changes from one color to another, so wouldn't fill any rectangle fully with the selected color, but I think I can make my own script :)
You can select any area, reset it to state 0 by pressing backspace, and then change cell states in the area from 0 to whatever you need. Clumsy, but works.
Ivan Fomichev
User avatar
Andrew
Moderator
Posts: 1053
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly: Filling selection with a color

Post by Andrew »

Lode wrote:When editing patterns in Golly (of a CA with more than two states), is there a way to fill the current selection with the current color?
Use fill.py from the Golly Scripts Database (go to Help > Online Archives).

Nearly all your later suggestions can be pretty easily implemented via Python scripts, so I'm reluctant to add those capabilities into Golly (but Golly is open source and I'd have no objections if somebody else wanted to add the necessary code).
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife and SpectreLife
User avatar
dvgrn
Moderator
Posts: 12040
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Golly: Filling selection with a color

Post by dvgrn »

Lode wrote:--draw line (e.g. using the pen tool with shift or ctrl click to draw line from previous point to here)
Check out draw-lines.py. Its behavior isn't quite the same as standard drawing tools in Paint-type programs, but it works (and can be modified to work differently if you want.)
Lode wrote:--a way to lock vertical or horizontal direction, so that you can draw straight lines (wires in wireworld, ...) easily
Again draw-lines.py could be used or modified. There's also a silly little trick that I use a lot: zoom in a bit, put the cell where you want to begin a long line on one edge of the screen, move the mouse to that cell, hold down the mouse button and move off the edge. You get a long guaranteed-straight line as Golly scrolls in that direction.
Lode wrote:--move selection content by dragging it (ctrl+x then ctrl+v is very awkward, especially because sometimes it mysteriously doesn't work or crashes)
Try move-selection.py and move-object.py. Again it might not work quite the way you expect, but there's definitely some potential there too...!

I was going to suggest assigning your own keyboard shortcuts to these scripts, but I tend to use a lot of keyboard shortcuts, and have gotten used to ctrl+x and ctrl+v. Maybe a good feature request would be a programmable toolbar that users could assign their own actions and scripts to, and then have them be accessible with the mouse.
Post Reply