Class: Viewport
- Inherits:
-
LiteRGSS::Viewport
- Object
- LiteRGSS::Disposable
- LiteRGSS::Viewport
- Viewport
- Defined in:
- docs/00000_Dependencies.rb,
docs/00700_Ajout_PSDK.rb
Overview
Class that describes a surface of the screen where texts and sprites are shown (with some global effect)
Defined Under Namespace
Modules: WithToneAndColors
Constant Summary collapse
- CONFIGS =
Hash containing all the Viewport configuration (:main, :sub etc…)
{}
- VIEWPORT_CONF_COMP =
Filename for viewport compiled config
'Data/Viewport.rxdata'
- VIEWPORT_CONF_TEXT =
Filename for viewport uncompiled config
'Data/Viewport.json'
Instance Attribute Summary collapse
-
#need_to_sort ⇒ Boolean
Tell if the viewport needs to sort.
Attributes inherited from LiteRGSS::Viewport
#__index__, #angle, #blendmode, #ox, #oy, #rect, #shader, #visible, #z, #zoom
Class Method Summary collapse
-
.create(x, y = 0, width = 1, height = 1, z = 0) ⇒ Viewport
Generating a viewport with one line of code.
-
.load_configs
Load the viewport configs.
Instance Method Summary collapse
-
#dispose ⇒ self
Dispose a viewport.
-
#flash(color, duration)
Flash the viewport.
-
#initialize(x, y, width, height, z = nil) ⇒ Viewport
constructor
Create a new viewport.
-
#simple_mouse_in?(mouse_x = Mouse.x, mouse_y = Mouse.y) ⇒ Boolean
Detect if the mouse is in the sprite (without rotation and stuff like that).
-
#to_s
(also: #inspect)
Format the viewport to string for logging purposes.
-
#translate_mouse_coords(mouse_x = Mouse.x, mouse_y = Mouse.y) ⇒ Array(Integer, Integer)
Convert mouse coordinate on the screen to mouse coordinates on the sprite.
-
#update
Update the viewport.
Methods inherited from LiteRGSS::Viewport
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(x, y, width, height, z = nil) ⇒ Viewport
Create a new viewport
569 570 |
# File 'docs/00000_Dependencies.rb', line 569 def initialize(x, y, width, height, z = nil) end |
Instance Attribute Details
#need_to_sort ⇒ Boolean
Tell if the viewport needs to sort
562 563 564 |
# File 'docs/00000_Dependencies.rb', line 562 def need_to_sort @need_to_sort end |
Class Method Details
.create(screen_name_symbol, z = nil) ⇒ Viewport .create(x, y = 0, width = 1, height = 1, z = nil) ⇒ Viewport .create(opts) ⇒ Viewport
Generating a viewport with one line of code
594 595 |
# File 'docs/00000_Dependencies.rb', line 594 def create(x, y = 0, width = 1, height = 1, z = 0) end |
.load_configs
Load the viewport configs
597 598 |
# File 'docs/00000_Dependencies.rb', line 597 def load_configs end |
Instance Method Details
#dispose ⇒ self
Dispose a viewport
573 574 |
# File 'docs/00000_Dependencies.rb', line 573 def dispose end |
#flash(color, duration)
Flash the viewport
606 607 |
# File 'docs/00000_Dependencies.rb', line 606 def flash(color, duration) end |
#simple_mouse_in?(mouse_x = Mouse.x, mouse_y = Mouse.y) ⇒ Boolean
Detect if the mouse is in the sprite (without rotation and stuff like that)
595 596 |
# File 'docs/00700_Ajout_PSDK.rb', line 595 def simple_mouse_in?(mouse_x = Mouse.x, mouse_y = Mouse.y) end |
#to_s Also known as: inspect
Format the viewport to string for logging purposes
601 602 |
# File 'docs/00000_Dependencies.rb', line 601 def to_s end |
#translate_mouse_coords(mouse_x = Mouse.x, mouse_y = Mouse.y) ⇒ Array(Integer, Integer)
Convert mouse coordinate on the screen to mouse coordinates on the sprite
602 603 |
# File 'docs/00700_Ajout_PSDK.rb', line 602 def translate_mouse_coords(mouse_x = Mouse.x, mouse_y = Mouse.y) end |
#update
Update the viewport
609 610 |
# File 'docs/00000_Dependencies.rb', line 609 def update end |