Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

Widget loader reference-relative positions #169

Closed seisatsu closed 7 years ago

seisatsu commented 7 years ago

Widget components in a widget file should have options to be placed at a position relative to a reference position, for example, so many pixels from the bottom of the screen. We might call this option "bottom" instead of "y", and only allow one or the other to be present.

pmer commented 7 years ago

For your information, CSS uses the same name for its version of this property. 👍

seisatsu commented 7 years ago

Properties to be implemented for all widget types, superseding x and y:

Each places the named side of the target widget w pixels away from the named side of its parent. The parent may be the viewport. Some math will be required when calculating for bottom or right, while top or left simply involve adding w to the x or y value of the widget. Bottom or right calculations require the height or width of the target widget, which may be undetermined until the widget is created. Therefore, these should be implemented in postprocessing, after the widget is created but before the next frame.

seisatsu commented 7 years ago

This objective is completed with the addition of the "align" property in bd6c273, which does the jobs of top, bottom, left, right, and justify in one property.