dxSetAspectRatioAdjustmentEnabled | Multi Theft Auto: Wiki Skip to content

dxSetAspectRatioAdjustmentEnabled

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows for the positioning of dxDraw calls to be automatically adjusted according to the client's aspect ratio setting. This lasts for a single execution of an event handler for one of the following events: onClientRender, onClientPreRender and onClientHUDRender. So the function has to be called every frame, just like dxDraws.

Syntax

dxSetAspectRatioAdjustmentEnabled ( )

Code Examples

client
scx,scy = guiGetScreenSize()
addEventHandler( "onClientRender", root,
function()
dxDrawText( "Hello", 300, 300 ) -- Text will be drawn at 300,300
dxSetAspectRatioAdjustmentEnabled( true )
dxDrawText( "Goodbye", 0.78*scx, 0.22*scy ) -- Text will be drawn just below HUD money, with any aspect ratio
end
)