This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
component:gpu [2017/03/28 05:23] payonel |
component:gpu [2018/06/15 21:53] 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` | ||
+ | Get the current viewport resolution. | ||
+ | - `setViewport(width: number, height: number): boolean` | ||
+ | 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. |