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