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:53]
ldentityunknown
component:gpu [2018/11/25 16:48] (current)
evg-zhabotinsky
Line 45: Line 45:
   Get the current viewport resolution.   Get the current viewport resolution.
 - `setViewport(width:​ number, height: number): boolean`  ​ - `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.+  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. This makes it look like screen resolution is lower, but the actual resolution stays the same. Characters outside top-left corner of specified size are just hidden, and are intended for rendering or storing things off-screen and copying them to the visible area when needed. Changing resolution will change viewport to whole screen.
 - <​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.