Class: Browser::Screen
- Includes:
 - Event::Target, NativeCachedWrapper
 
- Defined in:
 - opal/browser/screen.rb
 
Overview
Representation of the screen the window is being rendered on.
Defined Under Namespace
Classes: Depth
Instance Attribute Summary collapse
- 
  
    
      #depth  ⇒ Depth 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The screen depth.
 - 
  
    
      #height  ⇒ Integer 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The height of the screen in pixels.
 - 
  
    
      #orientation  ⇒ String 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The orientation of the screen.
 - 
  
    
      #position  ⇒ Position 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The offset from the top left corner of the screen in pixels.
 - 
  
    
      #size  ⇒ Size 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The size in pixels.
 - 
  
    
      #width  ⇒ Integer 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The width of the screen in pixels.
 - 
  
    
      #x  ⇒ Integer 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The offset from the top left corner of the screen in pixels.
 - 
  
    
      #y  ⇒ Integer 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The offset from the top left corner of the screen in pixels.
 
Method Summary
Methods included from Event::Target
#off, #on, #on!, #one, #trigger, #trigger!
Methods included from NativeCachedWrapper
#restricted?, #set_native_reference
Instance Attribute Details
#depth ⇒ Depth (readonly)
Returns the screen depth.
      50 51 52  | 
    
      # File 'opal/browser/screen.rb', line 50 def depth Depth.new(`#@native.colorDepth`, `#@native.pixelDepth`) end  | 
  
#height ⇒ Integer (readonly)
Returns the height of the screen in pixels.
      23  | 
    
      # File 'opal/browser/screen.rb', line 23 alias_native :height  | 
  
#orientation ⇒ String (readonly)
Returns the orientation of the screen.
      56  | 
    
      # File 'opal/browser/screen.rb', line 56 alias_native :orientation  | 
  
#position ⇒ Position (readonly)
Returns the offset from the top left corner of the screen in pixels.
      44 45 46  | 
    
      # File 'opal/browser/screen.rb', line 44 def position Position.new(x, y) end  | 
  
#size ⇒ Size (readonly)
Returns the size in pixels.
      27 28 29  | 
    
      # File 'opal/browser/screen.rb', line 27 def size Size.new(width, height) end  | 
  
#width ⇒ Integer (readonly)
Returns the width of the screen in pixels.
      19  | 
    
      # File 'opal/browser/screen.rb', line 19 alias_native :width  | 
  
#x ⇒ Integer (readonly)
Returns the offset from the top left corner of the screen in pixels.
      34  | 
    
      # File 'opal/browser/screen.rb', line 34 alias_native :x, :top  | 
  
#y ⇒ Integer (readonly)
Returns the offset from the top left corner of the screen in pixels.
      39  | 
    
      # File 'opal/browser/screen.rb', line 39 alias_native :y, :left  |