Ticket #110 (new task)

Opened 6 years ago

Last modified 19 months ago

GUI - Relational Coordinates

Reported by: stuart Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc:

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

comment:1 Changed 6 years ago by stuart

  • Owner set to gustav
  • Summary changed from Relational Coordinates to GUI - Relational Coordinates

comment:2 Changed 20 months ago by anonymous

  • Milestone Diplomacy Demo deleted

Milestone Diplomacy Demo deleted

comment:3 Changed 20 months ago by wacko

  • Milestone set to Backlog

comment:4 Changed 19 months ago by historic_bruno

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