SC2Mapster.com Wiki

SC2 API / Functions / PointWithOffset

PointWithOffset

point PointWithOffset(point base, fixed dx, fixed dy);

Create a new point translated by (dx, dy)

Parameters

point b

Base point

fixed dx

X translation

fixed dy

Y translation

Return value

point - New point defined by base translated by (dx, dy)

Examples

Example #1: Sample Usage
point p = Point(10, 30);
point t = PointWithOffset(p, 10, 15);
// t is Point(20, 45)
Example #2: Recode
point PointWithOffset(point p, fixed dx, fixed dy) {
  return Point(PointX(p) + dx, PointY(p) + dy));
}
// Note: It requires PointX and PointY
// http://www.sc2mapster.com/assets/basic-mathematic-functions/

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Mar 12, 2010

Author