Class: LiteRGSS::Viewport

Inherits:
Disposable show all
Defined in:
LiteRGSS.rb.yard.rb

Overview

Class that describes a surface of the screen where texts and sprites are shown (with some global effect)

Direct Known Subclasses

Viewport

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Disposable

#dispose, #disposed?

Instance Attribute Details

#__index__Integer (readonly)

Return the viewport “index” (used to know if the viewport has been created after an other sprite or viewport when z are the same

Returns:

  • (Integer)

    Return the viewport “index” (used to know if the viewport has been created after an other sprite or viewport when z are the same



330
331
332
# File 'LiteRGSS.rb.yard.rb', line 330

def __index__
  @__index__
end

#angleInteger

Returns Angle of the viewport contents.

Returns:

  • (Integer)

    Angle of the viewport contents



311
312
313
# File 'LiteRGSS.rb.yard.rb', line 311

def angle
  @angle
end

#blendmodeShader, BlendMode

Note:

Input is inverse of output due to internal logic (zoom=2 will make .zoom return 0.5) what matters is input, if you set 2, pixels will be 2x2

Returns Blend Mode of the viewport (can be specified in the shader).

Returns:

  • (Shader, BlendMode)

    Blend Mode of the viewport (can be specified in the shader)



317
318
319
# File 'LiteRGSS.rb.yard.rb', line 317

def blendmode
  @blendmode
end

#oxInteger

Returns The offset x of the viewport’s contents.

Returns:

  • (Integer)

    The offset x of the viewport’s contents



303
304
305
# File 'LiteRGSS.rb.yard.rb', line 303

def ox
  @ox
end

#oyInteger

Returns The offset y of the viewport’s contents.

Returns:

  • (Integer)

    The offset y of the viewport’s contents



305
306
307
# File 'LiteRGSS.rb.yard.rb', line 305

def oy
  @oy
end

#rectRect

Returns The surface of the viewport on the screen.

Returns:

  • (Rect)

    The surface of the viewport on the screen



301
302
303
# File 'LiteRGSS.rb.yard.rb', line 301

def rect
  @rect
end

#shaderShader, BlendMode

Returns Shader of the viewport (include the BlendMode properties).

Returns:

  • (Shader, BlendMode)

    Shader of the viewport (include the BlendMode properties)



319
320
321
# File 'LiteRGSS.rb.yard.rb', line 319

def shader
  @shader
end

#visibleBoolean

Returns Viewport content visibility.

Returns:

  • (Boolean)

    Viewport content visibility



307
308
309
# File 'LiteRGSS.rb.yard.rb', line 307

def visible
  @visible
end

#zNumeric

Returns The viewport z property.

Returns:

  • (Numeric)

    The viewport z property



309
310
311
# File 'LiteRGSS.rb.yard.rb', line 309

def z
  @z
end

#zoomInteger

Returns Zoom of the viewport contents.

Returns:

  • (Integer)

    Zoom of the viewport contents



313
314
315
# File 'LiteRGSS.rb.yard.rb', line 313

def zoom
  @zoom
end

Class Method Details

.new(window, x, y, width, height)

Create a new Viewport

Parameters:

  • window (DisplayWindow)

    window in which the viewport is shown

  • x (Integer)

    x position of the surface

  • y (Integer)

    y position of the surface

  • width (Integer)

    width of the surface

  • height (Integer)

    height of the surface



326
327
328
# File 'LiteRGSS.rb.yard.rb', line 326

def self.new(window, x, y, width, height)

end

Instance Method Details

#snap_to_bitmapBitmap

Return a snapshot of the viewport

Returns:



333
334
335
# File 'LiteRGSS.rb.yard.rb', line 333

def snap_to_bitmap

end

#sort_zself

Sort all the elements inside the viewport according to their z index

Returns:

  • (self)


338
339
340
# File 'LiteRGSS.rb.yard.rb', line 338

def sort_z

end