Class: Texture
- Inherits:
- LiteRGSS::Bitmap show all
- Defined in:
- scripts/00000 Dependencies/00001 LiteRGSS2/00000 DataClasses.rb
Overview
Class that stores an image loaded from file or memory into the VRAM
Constant Summary collapse
- SUPPORTED_EXTS =
List of supported extensions
%w[.png .PNG .jpg]
Instance Attribute Summary
Attributes inherited from LiteRGSS::Bitmap
Instance Method Summary collapse
-
#initialize(filename, from_mem = nil) ⇒ Texture
constructor
Initialize the texture, add automatically the extension to the filename.
Methods inherited from LiteRGSS::Bitmap
new, #to_png, #to_png_file, #update
Methods inherited from LiteRGSS::Disposable
Constructor Details
#initialize(filename, from_mem = nil) ⇒ Texture
Initialize the texture, add automatically the extension to the filename
22 23 24 25 26 27 28 29 30 |
# File 'scripts/00000 Dependencies/00001 LiteRGSS2/00000 DataClasses.rb', line 22 def initialize(filename, from_mem = nil) if from_mem || File.exist?(filename) super elsif (new_filename = SUPPORTED_EXTS.map { |e| filename + e }.find { |f| File.exist?(f) }) super(new_filename) else super(16, 16) end end |