Create an overlay which shows a grid

Bug #1529261 reported by kaputtnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Wishlist
Unassigned

Bug Description

In editor it is sometimes useful to have a grid shown. The grid should show the triangles of the fields and should be toggled with a shortcut and/or a button.

Attached is a mockup how this grid could be shown. May a different color should be used.

See: https://wl.widelands.org/forum/topic/1883/

Tags: editor ui

Related branches

Revision history for this message
kaputtnik (franku) wrote :
Changed in widelands:
assignee: nobody → Benedikt Straub (nordfriese)
status: Confirmed → In Progress
Revision history for this message
Benedikt Straub (nordfriese) wrote :

Which colour would you like to have for the grid?

Revision history for this message
kaputtnik (franku) wrote :

Hm... difficult to say... Have you tried a grayish color?

Where is the color defined, so i can play around with some colors?

Revision history for this message
Benedikt Straub (nordfriese) wrote :

The colour is set in data/shaders/grid.fp. The parameters are floating point values in the order RGBA.

I tried out a few colours so far. Dark gray and green are almost invisible on many terrains, and light gray or red are too glaring imho. I chose violet for now, but it´s not perfect…

Revision history for this message
kaputtnik (franku) wrote :

Hm, i think black is the best. Just because it adds no additional color and the contrast is good, imho. Problematic is showing the black grid on the Button. Maybe use white for the button?

The 2 images have the values from top to bottom:
gl_FragColor = vec4(.0, .0, 0., .6);
gl_FragColor = vec4(.9, .4, .1, .9);

Revision history for this message
kaputtnik (franku) wrote :

Hm, didn't tested Wasteland hills, but changing alpha from .6 to .8 will do the trick also for the terrain wasteland mountain1

Revision history for this message
Benedikt Straub (nordfriese) wrote :

OK, I set the grid colour to black. I made the button grayish, that looks similar to the grid and is properly visible.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build21-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :

Have a look at Surface::draw_line_strip - I think we could get better quality using that method.

Changed in widelands:
status: In Progress → Fix Committed
assignee: Benedikt Straub (nordfriese) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.