pub struct Screen(pub Address);Expand description
The screen component (9 methods).
Provided by OpenComputers’ Screen, TextBuffer, TextBufferBase.
Tuple Fields§
§0: AddressImplementations§
Source§impl Screen
impl Screen
Sourcepub fn get_aspect_ratio(&self) -> Result<(Number, Number)>
pub fn get_aspect_ratio(&self) -> Result<(Number, Number)>
The aspect ratio of the screen. For multi-block screens this is the number of blocks, horizontal and vertical.
Lua: screen.getAspectRatio():number, number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_aspect_ratio_async(&self) -> Result<(Number, Number)>
pub async fn get_aspect_ratio_async(&self) -> Result<(Number, Number)>
Self::get_aspect_ratio without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_keyboards(&self) -> Result<Value>
pub fn get_keyboards(&self) -> Result<Value>
The list of keyboards attached to the screen.
Lua: screen.getKeyboards():table
Indirect call: waits for the next server tick.
Sourcepub async fn get_keyboards_async(&self) -> Result<Value>
pub async fn get_keyboards_async(&self) -> Result<Value>
Self::get_keyboards without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_on(&self) -> Result<bool>
pub fn is_on(&self) -> Result<bool>
Returns whether the screen is currently on.
Lua: screen.isOn():boolean
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn is_on_async(&self) -> Result<bool>
pub async fn is_on_async(&self) -> Result<bool>
Self::is_on without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_precise(&self) -> Result<bool>
pub fn is_precise(&self) -> Result<bool>
Returns whether the screen is in high precision mode (sub-pixel mouse event positions).
Lua: screen.isPrecise():boolean
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn is_precise_async(&self) -> Result<bool>
pub async fn is_precise_async(&self) -> Result<bool>
Self::is_precise without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_touch_mode_inverted(&self) -> Result<bool>
pub fn is_touch_mode_inverted(&self) -> Result<bool>
Whether touch mode is inverted (sneak-activate opens GUI, instead of normal activate).
Lua: screen.isTouchModeInverted():boolean
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn is_touch_mode_inverted_async(&self) -> Result<bool>
pub async fn is_touch_mode_inverted_async(&self) -> Result<bool>
Self::is_touch_mode_inverted without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_precise(&self, enabled: bool) -> Result<bool>
pub fn set_precise(&self, enabled: bool) -> Result<bool>
Set whether to use high precision mode (sub-pixel mouse event positions).
Lua: screen.setPrecise(enabled:boolean):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_precise_async(&self, enabled: bool) -> Result<bool>
pub async fn set_precise_async(&self, enabled: bool) -> Result<bool>
Self::set_precise without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_touch_mode_inverted(&self, value: bool) -> Result<bool>
pub fn set_touch_mode_inverted(&self, value: bool) -> Result<bool>
Sets whether to invert touch mode (sneak-activate opens GUI, instead of normal activate).
Lua: screen.setTouchModeInverted(value:boolean):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_touch_mode_inverted_async(&self, value: bool) -> Result<bool>
pub async fn set_touch_mode_inverted_async(&self, value: bool) -> Result<bool>
Self::set_touch_mode_inverted without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn turn_off(&self) -> Result<bool>
pub fn turn_off(&self) -> Result<bool>
Turns the screen off. Returns whether the state changed, and whether it is now on.
Lua: screen.turnOff():boolean
Indirect call: waits for the next server tick.
Sourcepub async fn turn_off_async(&self) -> Result<bool>
pub async fn turn_off_async(&self) -> Result<bool>
Self::turn_off without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn turn_on(&self) -> Result<bool>
pub fn turn_on(&self) -> Result<bool>
Turns the screen on. Returns whether the state changed, and whether it is now on.
Lua: screen.turnOn():boolean
Indirect call: waits for the next server tick.
Sourcepub async fn turn_on_async(&self) -> Result<bool>
pub async fn turn_on_async(&self) -> Result<bool>
Self::turn_on without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Trait Implementations§
Source§impl Component for Screen
impl Component for Screen
Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.