Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
component:gpu [2018/06/15 21:33]
ldentityunknown getViewport+setViewport
component:gpu [2018/06/15 21:53] (current)
ldentityunknown
Line 41: Line 41:
   Gets the currently set resolution.   Gets the currently set resolution.
 - `setResolution(width:​ number, height: number): boolean`  ​ - `setResolution(width:​ number, height: number): boolean`  ​
-  Sets the specified resolution. Can be up to the maximum supported resolution. If a larger or invalid resolution is provided it will throw an error. Returns `true` if the resolution was set, `false` otherwise.+  Sets the specified resolution. Can be up to the maximum supported resolution. If a larger or invalid resolution is provided it will throw an error. Returns `true` if the resolution was changed (may return `false` if an attempt was made to set it to the same value it was set before), `false` otherwise.
 - `getViewport():​ number, number`  ​ - `getViewport():​ number, number`  ​
   Get the current viewport resolution.   Get the current viewport resolution.
-- `setViewport(number,​ number)` ​  +- `setViewport(width: ​number, ​height: ​number): boolean`   
-  Set the current viewport resolution.+  Set the current viewport resolution. Returns `true` if it was changed (may return `false` if an attempt was made to set it to the same value it was set before), `false` otherwise.
 - <​del>​`getSize():​ number, number`  ​ - <​del>​`getSize():​ number, number`  ​
   Gets the size in blocks of the screen the graphics card is bound to. For simple screens and robots this will be one by one.</​del>​ Deprecated, use `screen.getAspectRatio()` instead.   Gets the size in blocks of the screen the graphics card is bound to. For simple screens and robots this will be one by one.</​del>​ Deprecated, use `screen.getAspectRatio()` instead.