Name
csurface:SetDeviceScale -- set device scale
Synopsis
csurface:SetDeviceScale(x_scale, y_scale)
Function
Sets a scale that is multiplied to the device coordinates determined by the CTM when drawing to the surface. One common use for this is to render to very high resolution display devices at a scale factor, so that code that assumes 1 pixel will be a certain size will still work. Setting a transformation via ccontext:Scale() isn't sufficient to do this, since functions like ccontext:DeviceToUser() will expose the hidden scale.

Note that the scale affects drawing to the surface as well as using the surface in a source pattern.

Inputs
x_scale
a scale factor in the X direction
y_scale
a scale factor in the Y direction

Show TOC