iOSGraphics.Translate

From Xojo Documentation

Revision as of 16:29, 20 August 2018 by PLefebvre (talk | contribs) (Created page with "{{MethodBox | name = Translate | ownertype = class | scope = public | parameters = translateX As Double, translateY As Double | owner = iOSGraphics | project=Mobil...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

iOSGraphics.Translate(translateX As Double, translateY As Double)

Supported on Mobile(iOS).

Translates the origin point by the specified translateX and translateY values. Useful with Rotate.

Sample Code

From within an iOSCanvas.Paint event handler:

// Rotate square in center of graphics area
Const Pi = 3.14159
g.Translate(g.Width / 2, g.Height / 2)
g.Rotate(Pi / 4) ' 45 degrees or 1/8 of a circle
g.FillColor = Color.Blue
g.FillRect(10, 10, 50, 50)