Opened 18 years ago

Last modified 13 years ago

#110 new task

GUI - Relational Coordinates

Reported by: Stuart Walpole Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description

  • Problem: Most of the time we want a control to be a certain distance away from another control, or the same width, or stretching the area between two controls with a 5 pixel border, rather than positioned at a specific coordinate.
  • Solution: The GUIObject names of other controls can be referenced when setting a size property. eg size="OtherObject.left+30 10 OuterBox.right-5 40"
  • The upgraded size property would need to support:
    • Object names (including sprites; see below) as variables (to save the overhead of referring to them as getGUIObjectByName(objectName).size.x1; as in your example, it would use objectName.x1);
    • Retrieving any of the properties of a size, including x1, x2, y1, y2, rx1, rx2, ry1, ry2, left, top, right, bottom. I'd suggest also a few other precalculated values to save time (eg width (x2-x1) and height (y2-y1));
    • Simple operators (so that coordinates from other controls can be added/subtracted together);
    • Numeric values (so that, in the case of that control with a 5-pixel border, we can +/- 5 on the appropriate sides);
    • Common JS variables would be good (eg adding the value of a constant), but not essential;

Change History (4)

comment:1 by Stuart Walpole, 18 years ago

Owner: set to gustav
Summary: Relational CoordinatesGUI - Relational Coordinates

comment:2 by (none), 14 years ago

Milestone: Diplomacy Demo

Milestone Diplomacy Demo deleted

comment:3 by Andrew, 14 years ago

Milestone: Backlog

comment:4 by historic_bruno, 13 years ago

Owner: Gee removed
Note: See TracTickets for help on using tickets.