Class: LiteRGSS::Sprite
- Inherits:
-
Drawable
- Object
- Disposable
- Drawable
- LiteRGSS::Sprite
- Defined in:
- LiteRGSS.rb.yard.rb
Overview
Sprites cannot be saved, loaded from file nor cloned in the memory
Class that describe a sprite shown on the screen or inside a viewport
Direct Known Subclasses
Instance Attribute Summary collapse
-
#__index__ ⇒ Integer
readonly
Return the sprite index to know if it has been created before an other sprite (in the same viewport).
-
#angle ⇒ Numeric
The rotation of the sprite in degree.
-
#bitmap ⇒ Bitmap?
Texture shown by the sprite.
-
#height ⇒ Integer
readonly
Return the sprite height.
-
#mirror ⇒ Boolean
If the sprite texture is mirrored.
-
#opacity ⇒ Numeric
The opacity of the sprite.
-
#ox ⇒ Numeric
The x coordinate of the pixel inside the texture that is shown at x coordinate of the sprite.
-
#oy ⇒ Numeric
The y coordinate of the pixel inside the texture that is shown at y coordinate of the sprite.
-
#src_rect ⇒ Rect
Surface of the sprite’s texture show on the screen.
-
#viewport ⇒ Viewport, ...
The sprite viewport.
-
#visible ⇒ Boolean
If the sprite is shown or not.
-
#width ⇒ Integer
readonly
Return the sprite width.
-
#x ⇒ Numeric
X coordinate of the sprite.
-
#y ⇒ Numeric
Y coordinate of the sprite.
-
#z ⇒ Numeric
The z Coordinate of the sprite (for sorting).
-
#zoom ⇒ Numeric
writeonly
Define the zoom of the sprite when shown on screen.
-
#zoom_x ⇒ Numeric
The zoom scale in width axis of the sprite.
-
#zoom_y ⇒ Numeric
The zoom scale in height axis of the sprite.
Class Method Summary collapse
-
.new(viewport)
Create a new Sprite.
Instance Method Summary collapse
-
#set_origin(ox, oy) ⇒ self
Define the origine of the sprite (inside the texture).
-
#set_position(x, y) ⇒ self
Define the position of the sprite.
Methods inherited from Disposable
Instance Attribute Details
#__index__ ⇒ Integer (readonly)
Return the sprite index to know if it has been created before an other sprite (in the same viewport)
367 368 369 |
# File 'LiteRGSS.rb.yard.rb', line 367 def __index__ @__index__ end |
#angle ⇒ Numeric
Returns The rotation of the sprite in degree.
385 386 387 |
# File 'LiteRGSS.rb.yard.rb', line 385 def angle @angle end |
#bitmap ⇒ Bitmap?
Returns texture shown by the sprite.
369 370 371 |
# File 'LiteRGSS.rb.yard.rb', line 369 def bitmap @bitmap end |
#height ⇒ Integer (readonly)
Return the sprite height
399 400 401 |
# File 'LiteRGSS.rb.yard.rb', line 399 def height @height end |
#mirror ⇒ Boolean
Returns If the sprite texture is mirrored.
395 396 397 |
# File 'LiteRGSS.rb.yard.rb', line 395 def mirror @mirror end |
#opacity ⇒ Numeric
Returns The opacity of the sprite.
391 392 393 |
# File 'LiteRGSS.rb.yard.rb', line 391 def opacity @opacity end |
#ox ⇒ Numeric
Returns The x coordinate of the pixel inside the texture that is shown at x coordinate of the sprite.
381 382 383 |
# File 'LiteRGSS.rb.yard.rb', line 381 def ox @ox end |
#oy ⇒ Numeric
Returns The y coordinate of the pixel inside the texture that is shown at y coordinate of the sprite.
383 384 385 |
# File 'LiteRGSS.rb.yard.rb', line 383 def oy @oy end |
#src_rect ⇒ Rect
Returns Surface of the sprite’s texture show on the screen.
371 372 373 |
# File 'LiteRGSS.rb.yard.rb', line 371 def src_rect @src_rect end |
#viewport ⇒ Viewport, ...
Returns The sprite viewport.
393 394 395 |
# File 'LiteRGSS.rb.yard.rb', line 393 def @viewport end |
#visible ⇒ Boolean
Returns If the sprite is shown or not.
373 374 375 |
# File 'LiteRGSS.rb.yard.rb', line 373 def visible @visible end |
#width ⇒ Integer (readonly)
Return the sprite width
397 398 399 |
# File 'LiteRGSS.rb.yard.rb', line 397 def width @width end |
#x ⇒ Numeric
Returns X coordinate of the sprite.
375 376 377 |
# File 'LiteRGSS.rb.yard.rb', line 375 def x @x end |
#y ⇒ Numeric
Returns Y coordinate of the sprite.
377 378 379 |
# File 'LiteRGSS.rb.yard.rb', line 377 def y @y end |
#z ⇒ Numeric
Returns The z Coordinate of the sprite (for sorting).
379 380 381 |
# File 'LiteRGSS.rb.yard.rb', line 379 def z @z end |
#zoom=(value) ⇒ Numeric (writeonly)
Returns Define the zoom of the sprite when shown on screen.
365 366 367 |
# File 'LiteRGSS.rb.yard.rb', line 365 def zoom=(value) @zoom = value end |
#zoom_x ⇒ Numeric
Returns The zoom scale in width axis of the sprite.
387 388 389 |
# File 'LiteRGSS.rb.yard.rb', line 387 def zoom_x @zoom_x end |
#zoom_y ⇒ Numeric
Returns The zoom scale in height axis of the sprite.
389 390 391 |
# File 'LiteRGSS.rb.yard.rb', line 389 def zoom_y @zoom_y end |
Class Method Details
.new(viewport)
Create a new Sprite
347 348 349 |
# File 'LiteRGSS.rb.yard.rb', line 347 def self.new() end |
Instance Method Details
#set_origin(ox, oy) ⇒ self
Define the origine of the sprite (inside the texture)
361 362 363 |
# File 'LiteRGSS.rb.yard.rb', line 361 def set_origin(ox, oy) end |
#set_position(x, y) ⇒ self
Define the position of the sprite
354 355 356 |
# File 'LiteRGSS.rb.yard.rb', line 354 def set_position(x, y) end |