gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Define graphics layer in overlay #3936

Closed hqnghi88 closed 10 months ago

hqnghi88 commented 11 months ago

As in the screenshot, we have a 3d display which can rotate camera. And an overlay as minimap. However, in overlay we cannot define the graphics layer, so there is no solution for drawing the species (gis projected) to be scaled in the minimap size: the pink buildings cannot be fit in the small area in overlay.

Screenshot 2023-11-25 at 08 44 51
AlexisDrogoul commented 10 months ago

An overlay is a graphics layer so, as a workaround, have you tried, in the definition of the overlay, simply looping the buildings and drawing them directly as you intend to do on this layer (applying the correct scale, etc. manually) ? This workaround works well (I've tested it).

hqnghi88 commented 10 months ago

yes i was thinking about the looping of draw but how did you specify the "correct" scale??

AlexisDrogoul commented 10 months ago

Trial and error I suppose. If you specify the size of the overlay in pixels or whatever, you can probably apply a scaling to each agent...

hqnghi88 commented 10 months ago

A bit loss in how you specify the scaling for each agent in the overlay. how to scale their position and size? is it something like:

            loop b over: building{
                draw b size: {sub_scale, sub_scale};
            }

or adk building { do drawaspect;} ??

AlexisDrogoul commented 10 months ago

I would say probably the first one is safer. But try to directly modify the shape (you have more flexibility), like draw b.shape scaled_by: {...,...} rotated_by .... You can also merge all the geometries of the buildings and draw the result once (with draw geometry(building) scaled_to {x_size, y_size}), it will be easier to adjust I guess.

hqnghi88 commented 10 months ago

Dear Sir, The draw geometry(building) is what i seek for (stupid me) . It is totally fit my needs. Thank you.